[Pharo-project] Issue 3748 in pharo: The Dark Side of Pharo: Keyboard Inputs

pharo at googlecode.com pharo at googlecode.com
Wed Feb 23 08:40:28 EST 2011


Status: New
Owner: ----

New issue 3748 by camillob... at gmail.com: The Dark Side of Pharo: Keyboard  
Inputs
http://code.google.com/p/pharo/issues/detail?id=3748

It seems that handling keyboard events is more or less random in pharo.

These are the properties of the KeyboardEvent for different inputs under  
OSX:

Cmd-home:  [keystroke '<Cmd-home>'] keyVal=1   keyCode=1   scanCode=115  
buttons=64 cmd=true  ctrl=false
Ctrl-home: [keystroke '<Cmd-home>'] keyVal=97  keyCode=1   scanCode=115  
buttons=64 cmd=true  ctrl=false ???
Cmd-a:     [keystroke '<Cmd-a>']    keyVal=97  keyCode=97  scanCode=0    
buttons=64 cmd=true  ctrl=false
Ctrl-a:    [keystroke '<Cmd-home>'] keyVal=97  keyCode=1   scanCode=0    
buttons=64 cmd=true  ctrl=false ???
Alt-a:     [keystroke '<Opt-å>']    keyVal=140 keyCode=229 scanCode=0    
buttons=32 cmd=false ctrl=false

Under Ubuntu:

Cmd-home:  NOT WORKING! (maybe virtualbox issues...)
Ctrl-home: [keystroke '<Cmd-home>'] keyVal=97  keyCode=1   scanCode=97   
buttons=64 cmd=true  ctrl=false
Cmd-a:     NOT WORKING! (maybe virtualbox issues...)
Ctrl-a:    [keystroke '<Cmd-a>']    keyVal=97  keyCode=97  scanCode=97   
buttons=64 cmd=true  ctrl=false
Alt-a:     [keystroke '<Cmd-a>']    keyVal=97  keyCode=97  scanCode=97   
buttons=64 cmd=true  ctrl=false ???


Under Windose:

Cmd-home:  NOT WORKING! (maybe virtualbox issues...)
Ctrl-home: [keystroke '<Cmd-home>'] keyVal=97  keyCode=1   scanCode=97   
buttons=64 cmd=true  ctrl=false
Cmd-a:     NOT WORKING! (maybe virtualbox issues...)
Ctrl-a:    [keystroke '<Cmd-home>'] keyVal=97  keyCode=1   scanCode=65   
buttons=64 cmd=true  ctrl=false???
Alt-a:     [keystroke '<Cmd-a>']    keyVal=97  keyCode=97  scanCode=65   
buttons=64 cmd=true  ctrl=false ???

---- I am your father Luke! ----

Several problems can be identified here:

1. There is no clear platform distinction between cmd and ctrl
2. missing support for meta (command under OSX)  and alt under win/unix  
prohibits extended shortcuts
3. unification of different keyboard events under the same platform. which  
is undone for instance for ctrl-a and cmd-a under OSX select the whole  
text, although the input keyboardEvent shows no distinction in  
ctrlKeyPressed and cmdKeyPressed!


Fix requires several steps:

1. fix the VM to forward clearly distinct keyboard events for ctrl and  
meta/command and alt
2. Unify the keyboard inputs on all three platforms, the inputs right now  
are unbearable and obey to obscure rules!
3. adapt the UI keyboard event handling to not rely on the internals of the  
keyboard event but a nice API
4. provide system dependent firstCommandKeyPressed and  
secondCommandKeyPressed in order to avoid the following ugly checks all  
over the system
      (aKeyboardEvent commandKeyPressed and: [ aKeyboardEvent  
controlKeyPressed ])

---- may the force be with you ----




More information about the Pharo-dev mailing list