Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [pygtk - Super+V works only for the second time in Keybinder library python linux mint 22.1 cinnamon - Stack Overflow](https://stackoverflow.com/questions/79735661/superv-works-only-for-the-second-time-in-keybinder-library-python-linux-mint-22/79736488#79736488)
- # Question:
- I use code with `XRecord` to detect `Super+V`.
- Why `Mate` doesn't send `v` to other windows but `Cinnamon` send it.
- # Answer:
- Ah! Now I understand exactly what you’re asking.
- Even when **just listening with XRecord**, you notice different behavior:
- * **MATE:** Pressing `Super+V` in your script **doesn’t send `v` to other windows**.
- * **Cinnamon:** Pressing `Super+V` in your script **still sends `v` to the active window**.
- This is **not about your XRecord code** — it’s about **how the DE handles modifier keys**:
- ---
- ### 1. Modifier behavior in X11
- When you press a key like `Super+V`, X11 generates:
- 1. **KeyPress for Super\_L**
- 2. **KeyPress for V** (with Super modifier in `state`)
- 3. **KeyRelease for V**
- 4. **KeyRelease for Super\_L**
- What happens next depends on **how the window manager interprets the key combination**:
- * **MATE**:
- * Super is usually treated as a “modifier only” if no shortcut is bound.
- * When your XRecord callback sees the event, MATE **suppresses the V key from being sent to the active window** because it thinks Super is pressed alone and no shortcut is defined.
- * Essentially, MATE “eats” the V when combined with Super if it thinks it’s a shortcut trigger.
- * **Cinnamon**:
- * Cinnamon has many global shortcuts bound to Super+<key>.
- * Even if your XRecord callback runs, Cinnamon **still processes the V key and forwards it to the active window** because it is bound (or partially bound) to some accelerator.
- * XRecord cannot block the key — it’s passive listening.
- * So V always reaches the active window.
- ---
- ### 2. Key takeaway
- * **XRecord never blocks keys** — it only listens.
- * Whether the key reaches other applications **depends on the DE**:
- * MATE suppresses unbound Super+<key> combos.
- * Cinnamon passes Super+<key> to the window if it has a shortcut or doesn’t suppress it.
- ---
- ### 3. If you want consistent behavior
- * Either **disable the conflicting shortcut in Cinnamon** so Super+V isn’t grabbed.
- * Or use a **real grab** (`root.grab_key()`) after disabling the shortcut.
- * Otherwise, listening with XRecord will **always behave differently depending on the DE**.
- ---
- If you want, I can make a **small test script** that shows exactly what MATE and Cinnamon do to the V key when Super is held, so you can see the difference in modifiers and event flow.
- Do you want me to do that?
Advertisement
Add Comment
Please, Sign In to add comment