Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardware keyboard & mice input #29

Merged
merged 14 commits into from
Dec 19, 2017
Merged

Hardware keyboard & mice input #29

merged 14 commits into from
Dec 19, 2017

Conversation

tehKaiN
Copy link
Member

@tehKaiN tehKaiN commented Dec 18, 2017

This pull requests closes pull request #13 and does some work for #24 . Also, it brings as closer to abandoning intuition.

@tehKaiN tehKaiN added this to the Remove Intuition milestone Dec 18, 2017
* @param uwHiY Maximum cursor X position.
* @param uwHiY Maximum cursor Y position.
*/
void mouseSetBounds(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we have support for "multiple" simultaneous mouse handling... We should be able to set bounds for specific mouse.

Think about possibility to make split screen games with 2 connected mouses.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 776fae8

/**
* Bit value macro - useful for setting & testing bits.
*/
#define BV(x) (1 << (x))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be moved to more generic file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 7ba50f5

// determine mouse movement direction which takes into account joyxdat
// underflows and overflows.

if(g_sMouseManager.ubPortFlags & MOUSE_PORT_1) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This IFs should be totally a function with few variables. Only 4 hardcoded elements varies.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in dab7e1d

UWORD uwPotMask = 0;

// Enable RMB & MMB
if(ubPortFlags & MOUSE_PORT_1) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This IFs should be totally a function with few variables. Only 1 hardcoded element varies.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, since there is no need for that. Also, mouseCreate() is short enough to have this stuff written as it is right now. No need for moving every repetitive code to separate fn.

@tehKaiN tehKaiN merged commit aab827d into master Dec 19, 2017
@tehKaiN tehKaiN deleted the hardware-input branch December 19, 2017 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants