From: Trevor W. <pha...@me...> - 2015-04-02 11:04:22
|
Russell, I just want to make sure that we are looking at the same thing. I am running the script using the latest version of 8.5.18 from the Tcl/Tk download page. If I start the script, and enter the word “What” followed by two returns and the click the “Playback” button, here is the output I see from standard output: iMac27:projects trevorw$ /usr/local/bin/wish8.5 test.tcl 2015-04-02 05:48:41.814 Wish[1945:381544] Can't open input server /Library/InputManagers/GrowlSafari Keysym: Shift_L, char: {} Keysym: W, char: W Keysym: h, char: h Keysym: a, char: a Keysym: t, char: t Keysym: Return, char: Keysym: Return, char: Keysym: a, char: {} Keysym: a, char: W Keysym: a, char: h Keysym: a, char: a Keysym: a, char: t Keysym: Return, char: {} Keysym: Return, char: {} You’ll notice above that the keysym values after typing the text in the widget manually produce the correct results (the word “What” produces the keysym values of “W”, “h”, “a”, “t”); however, after clicking on the “Playback” button (where keystrokes are virtually created using the "event generate” command, the keysym values are not correct “a”, “a”, “a”, “a” (even though their associated char values are correct). Note that the Return keystrokes show the correct keysym value on playback. The text that shows up in the text widget is the correct text, but this isn’t the issue. The issue is that the keysym values are incorrect. If I run this same script using version 8.5.8 (on my box this is the X11 build), I get the following (correct) output at standard output: iMac27:projects trevorw$ wish8.5 test.tcl Keysym: Shift_L, char: {} Keysym: W, char: W Keysym: h, char: h Keysym: a, char: a Keysym: t, char: t Keysym: Return, char: Keysym: Return, char: Keysym: Shift_L, char: {} Keysym: W, char: W Keysym: h, char: h Keysym: a, char: a Keysym: t, char: t Keysym: Return, char: Keysym: Return, char: Looking at the 8.5.18 code base, I just don’t see how it could produce the correct keysym result as currently written. The keycode value passed to the KeycodeToUnicode function is wrong (in the case of printable characters the passed keycode value will always be 0, hence the value of ‘a’ being seen for all printable character keystrokes). I’ve tried (unsuccessfully to this point) to fix the issue by passing the correct keycode value to this function. The return Unicode value is not correct, resulting in keysym values that are either NoSymbol (“??”) values or values that don’t make any sense. Thanks, Trevor > On Apr 1, 2015, at 4:01 PM, Russell Owen <ro...@uw...> wrote: > > Your script seems to work fine for me. What I observe: > - When I type some text every char is shown correcting in stdout > - When I press Playback those same chars that I typed are entered into the text and echoed to stdout > - I repeated this sequence several times > > Did you get the latest 8.5.18; there were a few changes after the first announcement. > > — Russell > > On Apr 1, 2015, at 10:42 AM, Trevor Williams <pha...@me...> wrote: > >> Russell, >> >> Your script does not show the error I am speaking of. >> >> Try my script again, this time enter a small bit if text into the widget. Notice in the standard output that the keysym matches the char. >> >> Next, click the playback button. The standard output should now show the keysym value to be 'a' while the char value is correct. >> >> Can you see this behavior occurring now? >> >> Sent from my iPod >> >>> On Apr 1, 2015, at 12:23 PM, Russell Owen <ro...@uw...> wrote: >>> >>>> On 3/31/15 6:22 PM, Trevor Williams wrote: >>>> All, >>>> >>>> I'm seeing an issue with 8.5.18 build for Mac OSX where generating a key event such as: >>>> >>>> pack [text .t] >>>> event generate .t <Key-b> >>>> >>>> Will cause the %K (keysym) value to go to a bogus value (I consistently see the character "a" displayed). >>>> >>>> I have attached a sample script which demonstrates the issue. Anyone want to give it a try and confirm the issue? I tried the same script with 8.5.8 and that appears to produce the correct result. >>>> >>>> Thanks, >>>> Trevor >>> >>> The following script works for me on MacOS 10.9.5 using tcl/tk 8.5.18 >>> (your script did not work for me in wish because the text did not have >>> focus): >>> >>> pack [text .t] >>> button .b -text Generate -command {event generate .t <KeyPress-b>} >>> pack .b >>> >>> -- Russell >>> >>> >>> ------------------------------------------------------------------------------ >>> Dive into the World of Parallel Programming The Go Parallel Website, sponsored >>> by Intel and developed in partnership with Slashdot Media, is your hub for all >>> things parallel software development, from weekly thought leadership blogs to >>> news, videos, case studies, tutorials and more. Take a look and join the >>> conversation now. http://goparallel.sourceforge.net/ >>> _______________________________________________ >>> Tcl-mac mailing list >>> tc...@li... >>> https://lists.sourceforge.net/lists/listinfo/tcl-mac > |