[Cuis-dev] Character codePoint: and arrow keys

Mariano Montone marianomontone at gmail.com
Sat Aug 3 10:42:17 PDT 2024


I don't know if that's a bug or not.

How about using the methods in KeyboardEvent class?

I see: #isArrowDown, #isArrowLeft, etc in 'testing' category.


      Mariano

El 2/8/24 a las 11:42, Mark Volkmann via Cuis-dev escribió:
> I have a custom morph that implements the keyStroke: method to capture 
> keyboard events.
> I then use the following get the Character that corresponds to the key 
> value:
>
> char := Character codePoint: aKeyboardEvent keyValue.
>
> When I press the left arrow key, keyValue is 28 and the Character is a 
> left-pointing arrow.
> When I press the down arrow key, keyValue is 31 and the Character is a 
> down-pointing arrow.
> So far, so good. However ...
> When I press the right arrow key, keyValue is 29 and the Character is 
> an up-pointing arrow.
> When I press the up arrow key, keyValue is 30 and the Character is a 
> right-pointing arrow.
> Could this be a bug in the Character codePoint: method which uses 
> <primitive: 170>?
>
> -- 
> R. Mark Volkmann
> Object Computing, Inc.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240803/406ca2a5/attachment.htm>


More information about the Cuis-dev mailing list