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

Question: Shifts to parentheses #1

Open
JoshuaCrewe opened this issue May 8, 2020 · 4 comments
Open

Question: Shifts to parentheses #1

JoshuaCrewe opened this issue May 8, 2020 · 4 comments

Comments

@JoshuaCrewe
Copy link

So far this has been a very easy to use and effective tool 👍

I tried to map left shift to left parens but I couldn’t seem to get it to work.

Looking at the available options I thought LeftShift=KPLeftParen would get me there but it doesn’t output a (.

What am I misunderstanding?

@JoshuaCrewe JoshuaCrewe changed the title Question: Shifts to parenthesis Question: Shifts to parentheses May 8, 2020
@ursm
Copy link
Owner

ursm commented May 14, 2020

Hi, I'm glad you have used this little tool.

I'm not sure why KPLeftParen doesn't work, but I think it probably requires multi-key strokes like Shift + 9. Unfortunately osm does not currently have this feature.

I want to add this feature, but I'm not sure when I can get started. Of course, it's greatly appreciated if anyone challenges this. ;)

@JoshuaCrewe
Copy link
Author

Thanks for the response.

xcape worked in the same way I think and it would make sense that the system would need to simulate multiple keys. Karabiner on MacOs works like this too as far as I remember.

I am going to sit down and do a proper investigate about what it actually does.

I think the switch to Wayland is a slow process so let's play the long game with this one ;) I have done the smallest amount of Go but did enjoy it, I'll sit down with the code and see how this all works.

Cheers!

@ursm
Copy link
Owner

ursm commented Jan 22, 2022

@JoshuaCrewe
Now osm is able to map keys to parentheses. It's been a long time and I don't know if you still need this, but I hope it helps.

$ sleep 1 && sudo osm --device /dev/input/event5 --keymap LeftShift=KPLeftParen

Note: sleep 1 is needed because osm will malfunction if a key is pressed at startup (not required for autostart).

KeyPress event, serial 37, synthetic NO, window 0x3a00001,
    root 0x6c9, subw 0x3a00002, time 58999324, (44,53), root:(3934,172),
    state 0x0, keycode 187 (keysym 0x28, parenleft), same_screen YES,
    XLookupString gives 1 bytes: (28) "("
    XmbLookupString gives 1 bytes: (28) "("
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x3a00001,
    root 0x6c9, subw 0x3a00002, time 58999324, (44,53), root:(3934,172),
    state 0x0, keycode 187 (keysym 0x28, parenleft), same_screen YES,
    XLookupString gives 1 bytes: (28) "("
    XFilterEvent returns: False

@JoshuaCrewe
Copy link
Author

@ursm thanks for remembering this! I actually went with a different implementation in the end. https://gitlab.com/interception/linux/plugins/dual-function-keys

I recently did another dive into the Wayland state of play and am sticking with Xorg for the time being. I don't know when Wayland will actually be desirable. It is excellent to know there are multiple solutions to the key modding game though.

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

No branches or pull requests

2 participants