-
Notifications
You must be signed in to change notification settings - Fork 623
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
Rofi does not work well with custom layouts #485
Comments
Rofi sees the key as 'Alt-Backspace'. To see this, start rofi with: ' -kb-remove-char-back Alt+Backspace,Backspace'. Then it works. @sardemff7 do you have any solution for this? It seems we are not seeing just the final key, but also the raw keymap.. |
Confirming, |
@sardemff7 Does this look like a sane fix? diff --git a/source/view.c b/source/view.c
index 30a6da1..733c142 100644
--- a/source/view.c
+++ b/source/view.c
@@ -1189,8 +1189,10 @@ static void rofi_view_handle_keypress ( RofiViewState *state, xkb_stuff *xkb, xc
len = xkb_state_key_get_utf8 ( xkb->state, xkpe->detail, pad, sizeof ( pad ) );
}
- unsigned int modstate = x11_canonalize_mask ( xkpe->state );
+ xkb_mod_mask_t mod = xkb_state_serialize_mods ( xkb->state, XKB_STATE_MODS_EFFECTIVE );
+ xkb_mod_mask_t rrstate = xkb_state_mod_mask_remove_consumed ( xkb->state, key,mod );
+ unsigned int modstate = x11_canonalize_mask ( rrstate );
if ( key != XKB_KEY_NoSymbol ) {
KeyBindingAction action;
action = abe_find_action ( modstate, key ); |
This seems to remove shift/control from shift-enter/control-enter |
@xkbcommon What is the normal way to handle a situation like this? I can make specific exceptions, but prefer a nice solution? |
@DaveDavenport Does the discussion in xkbcommon/libxkbcommon#17 help at all? |
Thanks, I will give it a read. |
I took a look at the thread a few days back. It does not seem to help in my use-case. (I am probably doing something wrong, I think I just found out what I am doing wrong.) xkb_state_mod_mask_remove_consumed ( xkb->state, key,mod ); I get xkb_state_key_get_consumed_mods(struct xkb_state *state, xkb_keycode_t kc) It also returns 0. No mods consumed... What is it? If I look at implementation, it looks like we hit (present in both calls): key = XkbKey(state->keymap, kc);
if (!key)
return 0; This seems wrong behavior, in the first case it should return mask not 0. |
Ok, fixed above patch. |
For me the alt+i for backspace works, and shift/control-enter seems to work correctly. |
Confirming, works fine now. |
@DaveDavenport For what it's worth, |
you must have an amazing backlog, replying after 2 1/2 years. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Version
Version: 1.2.0
Configuration
Default
Launch Command
Any
Steps to reproduce
Configure your xkb layout to have some non-letter keys on the third level. For example:
Alternatively, try some layout that already has it (Neo?).
Then try using this key in rofi (AltGr+key).
What behaviour you see
Rofi does not recognize Backspace, Delete, Left, Right or any other non-letter key.
What behaviour you expect to see
I expect Backspace to work as Backspace, just like it does in any other program.
The text was updated successfully, but these errors were encountered: