Vaclav Smidl wrote:
I can reproduce this behavior (on Win XP). Windows converts a hardware "scan code" (unique to each key or key+modifier combination) into an ASCII (or Unicode) character. The "1" on the alphanumeric keyboard and the "1" on the numeric keypad (with NumLock toggled on) return different scan codes, but Windows will convert both to an ASCII "1". Apparently LyX (or at least the Windows port of LyX) is looking at the ASCII characer rather than the scan code when it does the binding. (IIRC, there's a C library function that will give you the scan code.)Hi all, I am trying to modify some key binding files to get the following:
if I press regular "1" insert "x" (for example)
if I press numeric "1" insert "1"
I am struggling with the following: If I use \kmap: it does not distinguish regular and numeric "1".
If I use: \bind "1" "self-insert x" \bind "KP_1" "self-insert 1" I am getting always 1,
If I use: \bind "KP_1" "self-insert 1" \bind "1" "self-insert x" I am getting always x.
Any thoughts, workarounds?
Thanks,
Vasek
Finding a work-around might be tough. I believe Microsoft has a free utility you can download to alter your keyboard mapping, which would let you map the numeric keypad "1" to some unused character, which you hopefully could bind in LyX to "self-insert 1", for instance. There are also some freeware mappers out there. The problem with that solution is that the keyboard mapping is not unique to a particular program -- the keys would be remapped system-wide (until you "unmapped" them).
-- Paul
******************************************************************************************
Paul A. Rubin Phone: (517) 432-3509
Department of Management Fax: (517) 432-1111
The Eli Broad Graduate School of Management E-mail: [EMAIL PROTECTED]
Michigan State University http://www.msu.edu/~rubin/
East Lansing, MI 48824-1122 (USA)
******************************************************************************************
Mathematicians are like Frenchmen: whenever you say something to them,
they translate it into their own language, and at once it is something
entirely different. J. W. v. GOETHE
