[Cuis-dev] Character codePoint: and arrow keys

Juan Vuletich juan at cuis.st
Mon Aug 12 06:49:28 PDT 2024


On 8/2/2024 11:42 AM, Mark Volkmann via Cuis-dev wrote:
> 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.

Well, there's no real relation between Characters 28, 29, 30, 31 and 
#keyValue using those numbers. Those 4 Characters are only used to show 
Smalltalk code, and are not intended for any other purpose.

Usually, the keyboard arrow keys are not used for entering characters 
but for controlling widget behavior in a way similar to a mouse.

So, I don't see this as a bug. We could make these consistent. Not sure 
of the value, though.

Opinions?

-- 
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240812/5f120698/attachment.htm>


More information about the Cuis-dev mailing list