On 08/17/2012 09:11 PM, Favux ... wrote:
> F1 through F12 X keycodes are already assigned, at least on a US
> layout keyboard. 67 thorugh 76 and 95,96.
>
> As long as a X keycode shows up (in xev for example) with a key/button
> press you should be able to bind it to a key with Xmodmap like so:
> $ xmodmap -e 'keycode 255 = F20'
> Then check it:
> $ xmodmap -pke | grep F20
> keycode 255 = F20 NoSymbol F20
>
> Or use compiz or whatever to bind the X keycode to a script rather
> than a key if you prefer to.
Ultimately, there are no keycodes that can't potentially collide with some
other input device. Thus, there is no difference which ones the tablet uses.
F1-F24 were chosen, because they're generic function buttons, which is more
or less what the tablet has.
The idea is to rely on users to map the buttons to useful keys. For this
tablet it is basically a requirement, because it seems to have several
modifications with buttons reported differently.
Since the tablet reports commonly used keys, we can't just remap them. We
need to remap them only for the tablet. AFAIK, currently, there are two ways
to do this: using setxkbmap with "-device" option and specifying xkb options
for an input class in X.org configuration.
While this will probably work, it is quite complicated and doesn't support
mapping a tablet button to a key combination (such as Ctrl+C or Ctrl+V).
My idea so far is to try to make xbindkeys support a way to specify the
input device to use. There exists xbindkeys-config, which makes
configuration a bit simpler. However, mapping keys with xbindkeys would
require invoking another program (such as xdotool) which would introduce an
input delay.
Sincerely,
Nick
|