This is the mail archive of the
cygwin-xfree
mailing list for the Cygwin XFree86 project.
RE: Problem with arrow keys in x-based applications on cygwin
- From: "Phil Betts" <Phil dot Betts at ascribe dot com>
- To: <cygwin-xfree at cygwin dot com>
- Date: Mon, 28 Jan 2008 10:07:33 -0000
- Subject: RE: Problem with arrow keys in x-based applications on cygwin
- Reply-to: cygwin-xfree at cygwin dot com
Per Thorlacius wrote on Sunday, January 27, 2008 7:30 PM::
> The arrow keys are not sending escape sequences, they are entirely
> ignored.
Do you get any keypress events when you press the keys? Try running
xev. In the window that opens, press the cursor keys and watch the
output. If you get an event when you press the keys, make a note of
the keycode.
You can then use xmodmap to associate the keycode with a keysym.
E.g. my keyboard produces the following keycodes:
Left 100
Right 102
Up 98
Down 104
Using this information I would create a .xmodmaprc file in my home
directory with the following lines:
keycode 98 = Up
keycode 100 = Left
keycode 102 = Right
keycode 104 = Down
I'm not sure if it matters in this case, but it's best to avoid
DOS style CRLF line endings, so don't use notepad to do this (or
if you do, run "d2u ~/.xmodmaprc" afterwards).
Run the command "xmodmap ~/.xmodmaprc" to enable the keys. This
command may be added to the script you use to start X. Note that
I have found it is necessary to wait for Xwin to complete its
initialisation, otherwise the command does nothing, so after
running Xwin, sleep for a few seconds before running xmodmap.
HTH
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/