Re: Joystick input driver and multimedia key events

2009-05-21 Thread Sascha Hlusiak
Am Donnerstag, den 21.05.2009, 19:33 +0200 schrieb Zarko Zivanov:
> After putting (and restarting X)
> 
>   Option "MapButton1""key=0x1008ff13"
>   Option "MapButton3""key=0x1008ff11"
> 
> this is what I get from xev for buttons 1 and 3:
> 
> KeyPress event, serial 49, synthetic NO, window 0x3c1,
> root 0x8c, subw 0x0, time 48271360, (529,604), root:(627,752),
> state 0x10, keycode 9 (keysym 0xff1b, Escape), same_screen YES,
> XLookupString gives 1 bytes: (1b) ""
> XmbLookupString gives 1 bytes: (1b) ""
> XFilterEvent returns: False
Keycode 9 is right, but the keysym associated with it comes from the
evdev keymap, not the joystick drivers keymap. There is no KeymapNotify
event when you change input devices? What version of xorg_server libXi
and the joystick driver are you using?

- Sascha


signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Re: Joystick input driver and multimedia key events

2009-05-21 Thread Zarko Zivanov
After putting (and restarting X)

Option "MapButton1""key=0x1008ff13"
Option "MapButton3""key=0x1008ff11"

this is what I get from xev for buttons 1 and 3:

KeyPress event, serial 49, synthetic NO, window 0x3c1,
root 0x8c, subw 0x0, time 48271360, (529,604), root:(627,752),
state 0x10, keycode 9 (keysym 0xff1b, Escape), same_screen YES,
XLookupString gives 1 bytes: (1b) ""
XmbLookupString gives 1 bytes: (1b) ""
XFilterEvent returns: False

KeyRelease event, serial 51, synthetic NO, window 0x3c1,
root 0x8c, subw 0x0, time 48271552, (529,604), root:(627,752),
state 0x10, keycode 9 (keysym 0xff1b, Escape), same_screen YES,
XLookupString gives 1 bytes: (1b) ""
XFilterEvent returns: False

KeyPress event, serial 51, synthetic NO, window 0x3c1,
root 0x8c, subw 0x0, time 48277632, (529,604), root:(627,752),
state 0x10, keycode 11 (keysym 0x32, 2), same_screen YES,
XLookupString gives 1 bytes: (32) "2"
XmbLookupString gives 1 bytes: (32) "2"
XFilterEvent returns: False

KeyRelease event, serial 51, synthetic NO, window 0x3c1,
root 0x8c, subw 0x0, time 48277792, (529,604), root:(627,752),
state 0x10, keycode 11 (keysym 0x32, 2), same_screen YES,
XLookupString gives 1 bytes: (32) "2"
XFilterEvent returns: False

Maybe is something Ubuntu-specific? Everything else is working except
those MM keycodes...

Žarko

On Thu, May 21, 2009 at 2:37 PM, Peter Hutterer
 wrote:
> On Thu, May 21, 2009 at 11:59:38AM +0200, Sascha Hlusiak wrote:
>> Hi,
>>
>> > Is it possible to use joystick driver to generate multimedia key
>> > events? I wanted to make i.e. buttons 1 and 3 to be volume up and
>> > volume down like this:
>> >
>> >         Option "MapButton1"        "key=0x1008,0xff13"
>> >         Option "MapButton3"        "key=0x1008,0xff11"
>> >
>> > I got codes 0x1008ff13 and 0x1008ff11 from xev (I didn't found
>> > appropriate constants in /usr/include/X11/keysymdef.h). I tried to put
>
> /usr/share/X11/XKeysymDB is the best collection of all keysyms.
> the codes you're looking for come from XF86Keysym.h)
>
>> > 32-bit numbers, but I got error about this, so i tried the above, but
>> > got nothing. If my approach is wrong, how could I get multimedia key
>> > actions to work with joystick driver?
>> configuring key=0x1008ff13 worked for me and produced the desired key. xev
>> shows the name as well so it's easy to check.
>>
>> While it is possible to generate those key events, there is a fundamental
>> problem with grabs on those keys. Basically, applications grab on scancodes 
>> of
>> a certain input device. Pressing a button on the joystick changes the primary
>> device and the key has to be regrabbed. But of course the first keystroke is
>> lost. For me the above configuration did raise the volume, but on the 2nd
>> button press only.
>> This problem exists with other input devices and grabs as well and is not a
>> joystick driver specific problem.
>
> FWIW, XI2 has keysym grabs instead of keycode grabs, so that problem should
> be gone.
>
> Cheers,
>  Peter
>
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: Joystick input driver and multimedia key events

2009-05-21 Thread Peter Hutterer
On Thu, May 21, 2009 at 11:59:38AM +0200, Sascha Hlusiak wrote:
> Hi,
> 
> > Is it possible to use joystick driver to generate multimedia key
> > events? I wanted to make i.e. buttons 1 and 3 to be volume up and
> > volume down like this:
> >
> > Option "MapButton1""key=0x1008,0xff13"
> > Option "MapButton3""key=0x1008,0xff11"
> >
> > I got codes 0x1008ff13 and 0x1008ff11 from xev (I didn't found
> > appropriate constants in /usr/include/X11/keysymdef.h). I tried to put

/usr/share/X11/XKeysymDB is the best collection of all keysyms.
the codes you're looking for come from XF86Keysym.h)

> > 32-bit numbers, but I got error about this, so i tried the above, but
> > got nothing. If my approach is wrong, how could I get multimedia key
> > actions to work with joystick driver?
> configuring key=0x1008ff13 worked for me and produced the desired key. xev 
> shows the name as well so it's easy to check.
> 
> While it is possible to generate those key events, there is a fundamental 
> problem with grabs on those keys. Basically, applications grab on scancodes 
> of 
> a certain input device. Pressing a button on the joystick changes the primary 
> device and the key has to be regrabbed. But of course the first keystroke is 
> lost. For me the above configuration did raise the volume, but on the 2nd 
> button press only.
> This problem exists with other input devices and grabs as well and is not a 
> joystick driver specific problem. 

FWIW, XI2 has keysym grabs instead of keycode grabs, so that problem should
be gone.

Cheers,
  Peter
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: Joystick input driver and multimedia key events

2009-05-21 Thread Sascha Hlusiak
Hi,

> Is it possible to use joystick driver to generate multimedia key
> events? I wanted to make i.e. buttons 1 and 3 to be volume up and
> volume down like this:
>
> Option "MapButton1""key=0x1008,0xff13"
> Option "MapButton3""key=0x1008,0xff11"
>
> I got codes 0x1008ff13 and 0x1008ff11 from xev (I didn't found
> appropriate constants in /usr/include/X11/keysymdef.h). I tried to put
> 32-bit numbers, but I got error about this, so i tried the above, but
> got nothing. If my approach is wrong, how could I get multimedia key
> actions to work with joystick driver?
configuring key=0x1008ff13 worked for me and produced the desired key. xev 
shows the name as well so it's easy to check.

While it is possible to generate those key events, there is a fundamental 
problem with grabs on those keys. Basically, applications grab on scancodes of 
a certain input device. Pressing a button on the joystick changes the primary 
device and the key has to be regrabbed. But of course the first keystroke is 
lost. For me the above configuration did raise the volume, but on the 2nd 
button press only.
This problem exists with other input devices and grabs as well and is not a 
joystick driver specific problem. 

- Sascha



signature.asc
Description: This is a digitally signed message part.
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Joystick input driver and multimedia key events

2009-05-20 Thread Zarko Zivanov
Is it possible to use joystick driver to generate multimedia key
events? I wanted to make i.e. buttons 1 and 3 to be volume up and
volume down like this:

Option "MapButton1""key=0x1008,0xff13"
Option "MapButton3""key=0x1008,0xff11"

I got codes 0x1008ff13 and 0x1008ff11 from xev (I didn't found
appropriate constants in /usr/include/X11/keysymdef.h). I tried to put
32-bit numbers, but I got error about this, so i tried the above, but
got nothing. If my approach is wrong, how could I get multimedia key
actions to work with joystick driver?

I'm using Ubuntu 9.04, joystick driver 1.4.0 and XOrg 7.4. I'm
successfully using joystick driver to emulate mouse.

Best regards,
Žarko
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg