Re: I lose characters because keycode of Fn is same than DEL

2011-07-05 Thread Jon TURNEY
On 04/07/2011 16:19, Phil Betts wrote:
 On 1 July 2011 16:13, Jon TURNEY jon.tur...@dronecode.org.uk wrote:
 I was aiming to generate an unused keycode, though, so I'm not sure I've
 picked a good one.
 
 Understood, although just about anything is preferable to Delete :)
 
 Since Fn functions as a modifier, perhaps one of the Mod keys, e.g.
 Mod5 might be a better choice.
 
 As long as it can be distinguished from any other key, we can use
 xmodmap to map it to whatever we want (e.g. Control_L for me).

Well, I was aiming for it to do nothing by default and then it can be mapped
to a modifier if desired.

 Can I see the output of 'setxkbmap  -print' as well, please?
 
 xkb_keymap {
 xkb_keycodes  { include xfree86+aliases(qwerty)   };
 xkb_types { include complete  };
 xkb_compat{ include complete  };
 xkb_symbols   { include pc+gb+inet(pc105) };
 xkb_geometry  { include pc(pc105) };
 };

Hm.. this is strange, I have the same keymap, but when I generate that key
event (I have to hack my X server to do that as I don't have a Fn key), I get:

KeyPress event, serial 27, synthetic NO, window 0x81,
root 0x101, subw 0x0, time 7868875, (90,80), root:(2056,142),
state 0x0, keycode 93 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False

KeyRelease event, serial 27, synthetic NO, window 0x81,
root 0x101, subw 0x0, time 7868968, (90,80), root:(2056,142),
state 0x0, keycode 93 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False

.. and this seems right looking at the output of 'xmodmap -pk', so there's
something else going on here I don't understand :-)

 I get the same output regardless of whether X is started with or without
 an external keyboard plugged in (is the external keyboard even
 considered?).

Not really, all the Windows keyboard input (which may come from real keyboards
or programs pretending to be one) is composed into a single virtual X keyboard.

Perhaps this isn't quite right but works well enough for most purposes :-)

-- 
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: I lose characters because keycode of Fn is same than DEL

2011-07-01 Thread Phil Betts
On 30 June 2011 17:51, Jon TURNEY jon.tur...@dronecode.org.uk wrote:
 I've fixed the mapping for this (undocumented) virtual key code, so hopefully
 this works correctly now. I've uploaded a snapshot at [1]

 I can't test this as the keyboards I have with an Fn key don't generate a
 separate keypress for that, apparently Lenovo laptops are special in this
 regard :-), so please let me know if this works.

 [1] ftp://cygwin.com/pub/cygwinx/XWin.20110630-git-e89b8ba1b44331d1.exe.bz2

Thanks Jon, that works a treat.

The new output for the Fn key is:
[ 89311.789] winTranslateKey: wParam 00ff lParam 01630001
[ 89311.789] winSendKeyEvent: dwKey: 85, fDown: 1, nEvents 2
[ 89311.789] winTranslateKey: wParam 00ff lParam c1630001
[ 89311.789] winSendKeyEvent: dwKey: 85, fDown: 0, nEvents 2

The corresponding output in xev is now:

KeyPress event, serial 27, synthetic NO, window 0x41,
root 0x101, subw 0x0, time 89443079, (86,83), root:(202,215),
state 0x0, keycode 93 (keysym 0xff7e, Mode_switch), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False

KeyRelease event, serial 27, synthetic NO, window 0x41,
root 0x101, subw 0x0, time 89443079, (86,83), root:(202,215),
state 0x0, keycode 93 (keysym 0xff7e, Mode_switch), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False

Phil

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: I lose characters because keycode of Fn is same than DEL

2011-07-01 Thread Jon TURNEY
On 01/07/2011 12:21, Phil Betts wrote:
 On 30 June 2011 17:51, Jon TURNEY jon.tur...@dronecode.org.uk wrote:
 I've fixed the mapping for this (undocumented) virtual key code, so hopefully
 this works correctly now. I've uploaded a snapshot at [1]

 I can't test this as the keyboards I have with an Fn key don't generate a
 separate keypress for that, apparently Lenovo laptops are special in this
 regard :-), so please let me know if this works.

 [1] ftp://cygwin.com/pub/cygwinx/XWin.20110630-git-e89b8ba1b44331d1.exe.bz2
 
 Thanks Jon, that works a treat.
 
 The new output for the Fn key is:
 [ 89311.789] winTranslateKey: wParam 00ff lParam 01630001
 [ 89311.789] winSendKeyEvent: dwKey: 85, fDown: 1, nEvents 2
 [ 89311.789] winTranslateKey: wParam 00ff lParam c1630001
 [ 89311.789] winSendKeyEvent: dwKey: 85, fDown: 0, nEvents 2
 
 The corresponding output in xev is now:
 
 KeyPress event, serial 27, synthetic NO, window 0x41,
 root 0x101, subw 0x0, time 89443079, (86,83), root:(202,215),
 state 0x0, keycode 93 (keysym 0xff7e, Mode_switch), same_screen YES,
 XLookupString gives 0 bytes:
 XmbLookupString gives 0 bytes:
 XFilterEvent returns: False
 
 KeyRelease event, serial 27, synthetic NO, window 0x41,
 root 0x101, subw 0x0, time 89443079, (86,83), root:(202,215),
 state 0x0, keycode 93 (keysym 0xff7e, Mode_switch), same_screen YES,
 XLookupString gives 0 bytes:
 XFilterEvent returns: False

Thanks.

I was aiming to generate an unused keycode, though, so I'm not sure I've
picked a good one.

Can I see the output of 'setxkbmap  -print' as well, please?

-- 
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: I lose characters because keycode of Fn is same than DEL

2011-06-30 Thread Jon TURNEY
On 30/06/2011 09:14, Phil Betts wrote:
 On 23 June 2011 12:34, Jon TURNEY jon.tur...@dronecode.org.uk wrote:
 On 10/06/2011 10:33, Paul Maier wrote:

 on a a IBM Lenovo Laptop T60 there is a Fn key to adjust the screen
 brightness and such.

 That Fn key has the same keycode than the DEL key.
 Therefore I can't change the Fn key with xmodmap (because I would change
 the DEL key the same way.)

 ...
 I think this is a bug in the way XWin translates Windows keystrokes into X
 keycodes.

 Can you run the X server with the extra option '-logverbose 3' and report
 what is written to /var/log/xwin/XWin.0.log when you press the Fn key.
 
 Since the OP hasn't responded, I have the same problem on a Lenovo R500
 laptop.  Running as suggested produces this when the Fn key is pressed:
 
 [   710.350] winTranslateKey: wParam 00ff lParam 01630001
 [   710.350] winSendKeyEvent: dwKey: 99, fDown: 1, nEvents 3
 [   710.366] winTranslateKey: wParam 00ff lParam c1630001
 [   710.366] winSendKeyEvent: dwKey: 99, fDown: 0, nEvents 2
 
 and this when the Delete key is pressed:
 
 [   730.240] winTranslateKey: wParam 002e lParam 01530001
 [   730.240] winSendKeyEvent: dwKey: 99, fDown: 1, nEvents 2
 [   730.349] winTranslateKey: wParam 002e lParam c1530001
 [   730.349] winSendKeyEvent: dwKey: 99, fDown: 0, nEvents 2

Thanks.

I've fixed the mapping for this (undocumented) virtual key code, so hopefully
this works correctly now. I've uploaded a snapshot at [1]

I can't test this as the keyboards I have with an Fn key don't generate a
separate keypress for that, apparently Lenovo laptops are special in this
regard :-), so please let me know if this works.

[1] ftp://cygwin.com/pub/cygwinx/XWin.20110630-git-e89b8ba1b44331d1.exe.bz2

-- 
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: I lose characters because keycode of Fn is same than DEL

2011-06-23 Thread Jon TURNEY

On 10/06/2011 10:33, Paul Maier wrote:

on a a IBM Lenovo Laptop T60 there is a Fn key to adjust the screen 
brightness and such.

That Fn key has the same keycode than the DEL key.
Therefore I can't change the Fn key with xmodmap (because I would change the 
DEL key the same way.)

When I adjust the screen brightness, I lose characters in the editor.
Unfortunately the Fn key REPEATS firing delete while the key is pressed.
And several times I didn't notice the loss before saving and leaving the editor.

Here is the output of xev when I press the Fn key: (Pressing the DEL key would 
yield the very same output.)


KeyPress event, serial 20, synthetic NO, window 0xa1,
 root 0x101, subw 0xa2, time 42594031, (35,42), root:(259,282),
 state 0x0, keycode 107 (keysym 0x, Delete), same_screen YES,
 XLookupString gives 1 bytes: (7f) 7f
 XFilterEvent returns: False


What can we do?


Thanks for the bug report.

I think this is a bug in the way XWin translates Windows keystrokes into X 
keycodes.


Can you run the X server with the extra option '-logverbose 3' and report what 
is written to /var/log/xwin/XWin.0.log when you press the Fn key.


--
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



I lose characters because keycode of Fn is same than DEL

2011-06-10 Thread Paul Maier
Hi,

on a a IBM Lenovo Laptop T60 there is a Fn key to adjust the screen 
brightness and such.

That Fn key has the same keycode than the DEL key.
Therefore I can't change the Fn key with xmodmap (because I would change the 
DEL key the same way.)

When I adjust the screen brightness, I lose characters in the editor.
Unfortunately the Fn key REPEATS firing delete while the key is pressed.
And several times I didn't notice the loss before saving and leaving the editor.

Here is the output of xev when I press the Fn key: (Pressing the DEL key would 
yield the very same output.)


KeyPress event, serial 20, synthetic NO, window 0xa1,
root 0x101, subw 0xa2, time 42594031, (35,42), root:(259,282),
state 0x0, keycode 107 (keysym 0x, Delete), same_screen YES,
XLookupString gives 1 bytes: (7f) 7f
XFilterEvent returns: False


What can we do?

Thank you!
  Paul


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/