Friday, 25 March 2016

XML : Openbox ArchLinux keybinding CapsLock in RC.xml

I got a little problem here with my shortcut definitions for Openbox keyboard actions. I want to use the caps lock key as a prefix to perform a shortcut.

I thought I'll remap the capslock key to the hyper key, done by setxkbmap -option caps:hyper

Output from xev before swapping caps and hyper:

  KeyRelease event, serial 48, synthetic NO, window 0x3400001,      root 0xf6, subw 0x0, time 2262248, (-560,518), root:(585,681),      state 0x2, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,      XLookupString gives 0 bytes:       XFilterEvent returns: False    

Output from xev after swapping caps and hyper:

  KeyRelease event, serial 48, synthetic NO, window 0x3400001,      root 0xf6, subw 0x0, time 2364568, (-112,127), root:(1033,290),      state 0x40, keycode 66 (keysym 0xffed, Hyper_L), same_screen YES,      XLookupString gives 0 bytes:       XFilterEvent returns: False    

Alright, so far, so good. Defining an action with the Hyper Key in RC.xml, like:

  </keybind>  <keybind key="H-x">    <action name="Execute">      <command>gmrun</command>    </action>  </keybind>    

works actually!

But, when I use the super key and push x gmrun gets executed as well. In some way, the super key works as hyper as well. Hmm, is that the right assumption or what do I miss here?

Btw, here the xev output from Super so it's obviously a different key.

  KeyRelease event, serial 48, synthetic NO, window 0x3400001,      root 0xf6, subw 0x0, time 2657169, (-294,402), root:(851,565),      state 0x40, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,      XLookupString gives 0 bytes:       XFilterEvent returns: False     

Well, I noticed the keycode from caps lock didn't change after using the setxkbmap command. In both conditions its keycode 66 (even after setxkbmap -option caps:none).

Relying on http://openbox.org/wiki/Help:Bindings#Keys it's actually possible to use the key code, I changed my RC.xml example to:

  </keybind>      <keybind key="0x42-x">        <action name="Execute">          <command>gmrun</command>        </action>      </keybind>    

But this doesn't work at all. Would be nice to use the keycode so no dealing with setxkbmap, but either ways don't know which part I've missed and I'm grateful for every hint guys! Cheers

No comments:

Post a Comment