[Q]: Keyboard key handling

Thierry Reignier thierry_reignier at hotmail.com
Mon Jan 27 13:00:01 UTC 2003


Hi,

For info:
VM: Win32 - Squeak3.3alpha of 24 January 2002 [latest update: #4967]
Image: Squeak3.5alpha [latest update: #5168]

Here comes results of 6 key combinations:
Crtl+Return:
   KeyboardEvent:[keystroke '^m'] (buttons: 16, keyValue: 13)
   EventBufer: #(2 4583260 13 0 2 0 0 0)

Alt+Return:
   KeyboardEvent:[keystroke '
'] (buttons: 64, keyValue: 13)
   EventBufer: #(2 4790638 13 0 8 0 0 0)

Crtl+m
   KeyboardEvent:[keyUp ''] (buttons: 0, keyValue: 17)
   EventBufer: ##(2 5261315 17 2 0 0 0 0)
   Note: caught in keyUp: method and never pass to keyStroke:

Alt+m
   KeyboardEvent:[keystroke 'm'] (buttons: 64, keyValue: 109)
   EventBufer: #(2 4883371 109 0 8 0 0 0)

Alt+n
   KeyboardEvent:[keystroke 'n'] (buttons: 64, keyValue: 110)
   EventBufer: #(2 22024008 110 0 8 0 0 0)

Ctrl+n
  KeyboardEvent:[keystroke '^n'] (buttons: 16, keyValue: 14)
  EventBufer: #(2 22106767 14 0 2 0 0 0)

My questions are:
1. why is a convertion needed when control is pressed?
As best shown in
	KeyboardEvent>>printString:

	self controlKeyPressed
		ifTrue: [aStream nextPutAll: ' ''^'.
			aStream nextPut: (keyValue + $a asciiValue - 1) asCharacter]
It actually works for ctrl+n (case 6) but not it is wrong for ctrl+return 
(case 1).
Can't Ctrl be handled corectly in eventBuffer as Alt where return = 13 and m 
= 109?

2. Why is ctrl+m caught by keyUp? or why is
   eventBufer at: 4 = 2
and not
   eventBuffer at: 5 = 2!

need more info?

Thanks for any reply

Thierry

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail



More information about the Squeak-dev mailing list