From: Yan W. <yan...@un...> - 2003-08-11 16:28:12
|
On Monday, August 11, 2003, at 04:36 pm, Benjamin Riefenstahl wrote: > Hi Yan, > > I get "Return" for both keys, same versions of Tcl and OS as you gave. > Apropos versions, that's the Aqua version of Tcl, not the MacOS > Classic version, right? The TclTkAquaBI-8.4.4.0.dmg disk image from http://www.maths.mq.edu.au/~steffen/tcltk/TclTkAqua/ >> Which test program? I'm not subscribed to the lists, and the archive >> seems to be broken, so I may have missed some of the conversation. > > Sorry, I just forwarded that message to you now. The test program > also prints the keycode. If all else fails and you really need this, > you should be able use the keycode to detect KP_Enter. This is what I get on my G4 powerbook's built-in keyboard, which, because it has no numeric keypad, has a rather strange way of doing it. There are 2 ways of pressing <enter>: one dedicated key on the bottom right, immediately to the left of the cursors, and another activated by pressing <function-return>. Something funny is going on here, because they both work as expected in, say, the TextEdit application, but pressing the dedicated key in Word brings up a different character. Here are the results of your program (including using an external keyboard with a "proper" enter key) --- pressing Return on the built-in keyboard --- ############### <KeyPress>: KeyCode=<0x24000D> Unicode=<> KeySym=<Return> detail=?? sendevent=0 type=2 ############### <KeyRelease>: KeyCode=<0x24000D> Unicode=<> KeySym=<Return> detail=?? sendevent=0 type=3 --- pressing Enter using the dedicated key on the built-in keyboard --- ############### <KeyPress>: KeyCode=<0x340003> Unicode=<> KeySym=<??> detail=?? sendevent=0 type=2 ############### <KeyRelease>: KeyCode=<0x340003> Unicode=<> KeySym=<??> detail=?? sendevent=0 type=3 --- pressing Enter using function-return on the built-in keyboard --- --- (I have snipped the keypresses before and after as a result of pressing the <function> key) --- ############### <KeyPress>: KeyCode=<0x4C0003> Unicode=<> KeySym=<Return> detail=?? sendevent=0 type=2 ############### <KeyRelease>: KeyCode=<0x4C0003> Unicode=<> KeySym=<Return> detail=?? sendevent=0 type=3 --- pressing Enter using an external USB keyboard --- ############### <KeyPress>: KeyCode=<0x4C0003> Unicode=<> KeySym=<Return> detail=?? sendevent=0 type=2 ############### <KeyRelease>: KeyCode=<0x4C0003> Unicode=<> KeySym=<Return> detail=?? sendevent=0 type=3 ---------------- Would it be possible to add the <0x340003> keycode as another enter key? I don't know why it is doing something different to the external keyboard. Changing the keyboard layout from British to US doesn't do anything. >> By the way, does the Enter key work (i.e. give the KP_Enter keysym) >> in Linux and Windows? > > Gives <KP_Enter> on Linux, but only <Return> on Windows. I think > there was an enhancement requets for Windows on that, but I don't > know how far that is. Thanks. The linux version I have is only 8.3, and doesn't have it, but I assume that 8.4 or so added this functionality. It is a shame about the windows version. Hopefully it will be fixed in an upcoming release. Cheers, and thank you for helping with this. Yan |