KeyboardEvent differences between platforms

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

KeyboardEvent differences between platforms

Guillermo Polito
In TextEditor>>initializeShiftCmdKeyShortcuts the shortcuts are set in a way that it creates three handlers for each shortcut to make it work xD.

The main difference here is that in Linux, ubuntu 11.04 the Ctrl+a comes with the right keyCharacter, but in Windows and MacOS it does not :(.  We've tested that on host OSs with friends :).

I've captured the problem I'm experimenting so far and wrote down an ugly hack in this method.

KeyboardEvent>>modifiedCharacter
    self flag: #hack.
    "Hack me.  When Ctrl is pressed, the key ascii value is not right and we have to do this shit"
    ^(self controlKeyPressed and: [ (#(MacOSX Windows) includes: Smalltalk os current platformFamily) and: [ keyValue <= 26 ]])
        ifTrue: [ (self keyValue + $a asciiValue - 1) asCharacter ]   
        ifFalse: [ self keyCharacter ]


But I'd like to replace that by:

KeyboardEvent>>modifiedCharacter
    ^self keyCharacter

:P


Are there any technical reasons why the Sensor behaves like that?  How difficult is it to make it work the same for all three vms?

Thanks!
Guille

_______________________________________________
VM-beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/vm-beginners