-
Notifications
You must be signed in to change notification settings - Fork 124
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
request: add RedirectKey action #18
Comments
Hi, I'm in the same situation. My chromebook doesn't have Home/End/etc. Once Wayland becomes a little bit more mature, I'd like to continue to use the same solution. I believe this will help many users as many small laptops/tablet keyboards/etc don't have a full keyboard, but rather a keyboard with a subset of keys. |
@pedronariyoshi In fact Wayland is pretty mature, Gnome Wayland session works perfectly on my C720 and it much snappier than X (though everything still run through xwayland), if the touchpad's tap-to-click actions and extra mouse buttons (back, next) weren't missing from Gnome's Wayland session then I would be moving to it today (and I'll bet these will be fixed two months from now with Gnome 3.16). |
My Chromebook as well would be missing those feature because it has a different type of keyboard. Thank you |
@dhead666 Thanks for opening a bug. First to explain why RedirectKey doesn't work currently: in general, we try to support all of the features in Xkb, unless
Unfortunately RedirectKey is the 3rd... It is inherently a server/compositor-side feature; to quote the Xkb spec for
Basically it mangles the key events sent to the client. However libxkbcommon is a generic library and doesn't act as a midlayer or deal with events directly in any way (as opposed to the xkb stuff in xserver and xlib), so we can't just implement actions like these in the library. These are the same reasons we don't currently handle some accessibility features which are specified in xkb (like mousekeys and others, which need to synthesize, alter and suppress events, timers and what not). In the Wayland case in particular, if such features are desirable and the proper place for their configuration is in the xkb keymap, then we will need to expose some API to the compositor (hopefully not involving callbacks...). So there's a larger architectural consideration here, closely related to keyboard accessibility. I'd suggest you bring this up with the Wayland devs (wayland-devel mailing list) - if the data from the keymaps is eventually needed we can certainly expose it. |
Do you mean that some changes are also needed to be made in each compositor? (Weston, Gnome ...)
Are these important features? if so then how these features supposed to be implemented? via the compositor? or maybe this is something that Wayland is actually lacking? I'll bring it up in the wayland-devel mailing list but I'm not sure I really understand Wayland inner workings (I'm pretty sure I don't). Also as a user (and not a developer) it sounds to me like a solution that's too complex and might not be worth pursuing, at least if it's only needed for my specific use case. |
Well if you are content in doing the redirection in another layer, that's possible in linux at least. See here: https://gist.github.com/bluetech/c5839c78278200c668e0 (just the needed syscalls; of course if you want to actually use this you'd need to work on the script a bit). |
I just realized dumping a C file on a user might not be very helpful to him... If you need help with it let me know. Also note that it redirects the key on the device for the entire system: also on the tty's, for other users, etc. |
@bluetech thanks, that is very helpful as I'm inexperience a bit in coding but I do want to improve my skills and this is a great example. My main issue is mapping key press combinations (e.g Alt+Shift+Up) so I believe that I will need to read the status of the button(s) (pressed, released) which I don't believe possible with EVIOCGKEYCODE. Anyway, I can continue this discussion via email so I won't spam every subscribed developer. Also, ATM I'm less concern in having the RedirectKey action in libxkbcommon because it seem like it should be easier to implement what I need by manipulating the events directly from the input device, so you're welcome to close this issue and also #19 (as it only effect keys that I mapped to actions). |
@dhead I don't know about other subscribers, but I would like to see the Pedro Nariyoshi On Wed, Feb 4, 2015 at 9:10 AM, dhead666 [email protected] wrote:
|
Doesn't binding the appropriate keysyms to higher levels work for Home/End/PgUp/PgDown, i.e. without any action/redirect stuff? the |
@stev47 it seems that in the patch @dhead666 linked to, he already tried that (see the keysyms in the 3rd level). @dhead666 why indeed do you need to need to actually redirect the key at all, are the keysyms not sufficient? Perhaps some programs look at the keycode directly, instead of the keysym (you mentioned firefox, chrome, libreoffice)? |
@bluetech you are correct, the RedirectKey needed for those three apps. I didn't investigate yet a proper solution suitable for my needs (I've got lots to learn, just started reading
|
Indeed, we are not likely to implement Regarding the reason you need Have fun with TLPI! |
Sadly there are still many applications that need "clearmods" to work. E.g. Using arrow keys while alt-tabbing on |
I would also need this. Chrome also looks at keycodes instead of keysyms, so you need to make it use X11 instead of Wayland (ozone setting) if you want working keys. |
Hi,
On my Chromebook I mapped Shift+Alt+Left/Right/Up/Down to Home/End/PgUp/PgDown in xkeyboard-config as the Chromebook keyboard lacks these keys.
To be able to use these hotkeys on Chromium, Firefox and LibreOffice in X session I needed to add the RedirectKey function.
I would love to be able to use the RedirectKey action also in a Wayland session.
I would add that in X session this feature does have an issue: when holding down the hotkey which was mapped with RedirectKey action (e.g. holding Alt+Shift+Down for a few seconds) then sometimes the system will stop responding to the hotkey and it'll take a few seconds for the system to respond to another key press, maybe it can described as the RedirectKey action overflow some buffer and then it takes a few seconds to flush it.
See my changes to xkeyboard-config <- Edit: Updated link the patch
The text was updated successfully, but these errors were encountered: