[Pharo-project] Written down current Keyboard Event Model
Maybe this has to be written in the wiki, the book, or something :P. Keyboard interaction raises 3 events: - Keydown When a key is pressed, it informs the same as a keystroke. *Nobody uses it :/.* Also, between platforms, the keydown events are different ¬¬. Even more!! These events are not taken into account by morphic EventHandler :D. Just try: aMorph on: #keyDown send: #value to: [ UIManager inform: 'hello!'] - Keyup When a key is released, it informs the same as a keystroke. *Nobody uses it :/.* Also, between platforms, the keyup events are different ¬¬. Even more!! Those events are not taken into account in morphic EventHandler :D. Just try: aMorph on: #keyUp send: #value to: [ UIManager inform: 'hello!'] - Keypress When a key with a unicode representation is pressed, informs: -modifiers. Hey guess what? If you type ctrl+a character, you'll get cmd+that character. Be careful ;). -keyCode: a value representing the key pressed (not the character equivalent) -keyCharacter: a character representing the key pressed. It may not be a printable character, so, be careful ;). to subscribe a morph to this event just do: Even more!! They are not took into account in morphic EventHandler :D. Just try: aMorph on: #keyStroke send: #value to: [ UIManager inform: 'hello!' ]. Guille, messing with events and stuff, and vms, and bored :P
Guillermo what you are doing is really cool. We should take notes and really improve the system. I read the remark of Juan and (did not get enough time to get it). but we need a good way to handle events in a good way. So it would be great if you could log all your findings into a document, - first it could help everybody when we discuss - second we could (not sure but why not) write an article for ESUG workshop. Stef On Jan 26, 2012, at 7:02 PM, Guillermo Polito wrote:
On Thu, Jan 26, 2012 at 2:47 PM, Guillermo Polito <guillermopolito@gmail.com> wrote: to subscribe a morph to this event just do:
Actually, we do work :). We are the only one. Just try:
aMorph on: #keyStroke send: #value to: [ UIManager inform: 'hello!' ].
participants (2)
-
Guillermo Polito -
Stéphane Ducasse