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

Fix a mouse binding for non english keymap #404

Merged

Conversation

rdnvndr
Copy link
Contributor

@rdnvndr rdnvndr commented Aug 14, 2017

No description provided.

@rdnvndr
Copy link
Contributor Author

rdnvndr commented Aug 15, 2017

IMHO it does not matter, bitwise operators are used. For non english keymap "state" returns other value. Therefore, the "state" must be converted to the ASCII character.

@joewing
Copy link
Owner

joewing commented Aug 16, 2017

What are the other things showing up in state that you're trying to mask out? The point of lockMask here is to mask out things that we don't care about, so rather than pushing 0xFF around, this should update lockMask, preferably using a constant from the X11 headers or updating the lockMods array.

@rdnvndr
Copy link
Contributor Author

rdnvndr commented Aug 16, 2017

I'm wrong. Need further study of the problem.
PS: For non english keymap(russian) "state" is "0x2000"

@rdnvndr
Copy link
Contributor Author

rdnvndr commented Aug 16, 2017

I have not found a key symbol for state "0x2000". I added masks. Constants for these bits don't exist in file "X.h"

@joewing
Copy link
Owner

joewing commented Aug 17, 2017

I wonder if this is related to mouse buttons instead of the keyboard perhaps (do you have a mouse with more than 5 buttons)? It seems strange that the mask would be 1<<13, which is right after Button5Mask. In other words, it looks like this would be the logical place for Button6Mask and 1<<14 would be Button7Mask.

I think this is probably an ok fix, considering these values seem in line with what X11 defines for mouse masks and it doesn't appear to define anything higher than Button5.

In any case, would you mind squashing the first commit?
Thanks!

@rdnvndr
Copy link
Contributor Author

rdnvndr commented Aug 17, 2017

In any case, would you mind squashing the first commit?

I do not mind.

I have a notebook LENOVO ThinkPad S540 without mouse. I think that bits 1<<13 and 1<<14 is number of keymap in Option "XkbLayout" us,ru". I did not have time to check it out.

@rdnvndr
Copy link
Contributor Author

rdnvndr commented Aug 17, 2017

I think that bits 1<<13 and 1<<14 is number of keymap in Option "XkbLayout" us,ru"

That's right. A maximum of four working layouts.

@rdnvndr rdnvndr force-pushed the mouse-binding-for-non-english-keymap branch from dfba844 to 3572cb8 Compare August 17, 2017 15:19
Add masks (1 << 13) and (1 << 14)
@joewing joewing merged commit 5ebae6d into joewing:master Aug 17, 2017
@joewing
Copy link
Owner

joewing commented Aug 17, 2017

Thanks!

@rdnvndr rdnvndr deleted the mouse-binding-for-non-english-keymap branch August 18, 2017 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants