<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 8/2/2024 11:42 AM, Mark Volkmann via Cuis-dev wrote:
<blockquote
cite="mid:CAFfRWnXxR0ti932LfadbKRcA+xqFikKRNGSSr1mszpuz4_1Qkw@mail.gmail.com"
type="cite">
<div dir="ltr">I have a custom morph that implements the
keyStroke: method to capture keyboard events.
<div>I then use the following get the Character that corresponds
to the key value:</div>
<div><br>
</div>
<div>char := Character codePoint: aKeyboardEvent keyValue.</div>
<div><br>
<div>When I press the left arrow key, keyValue is 28 and the
Character is a left-pointing arrow.</div>
<div>When I press the down arrow key, keyValue is 31 and the
Character is a down-pointing arrow.</div>
<div>So far, so good. However ...<br clear="all">
When I press the right arrow key, keyValue is 29 and the
Character is an up-pointing arrow.<br>
<div>When I press the up arrow key, keyValue is 30 and the
Character is a right-pointing arrow.</div>
<div>Could this be a bug in the Character codePoint: method
which uses <primitive: 170>?<br clear="all">
<br class="gmail-Apple-interchange-newline">
</div>
<span class="gmail_signature_prefix">-- </span><br>
<div dir="ltr" class="gmail_signature"
data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr">
<div><font face="arial, helvetica, sans-serif">R.
Mark Volkmann</font></div>
<div><span style="font-size: 12.8px;"><font
face="arial, helvetica, sans-serif">Object
Computing, Inc.</font></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
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.<br>
<br>
Usually, the keyboard arrow keys are not used for entering
characters but for controlling widget behavior in a way similar to a
mouse.<br>
<br>
So, I don't see this as a bug. We could make these consistent. Not
sure of the value, though.<br>
<br>
Opinions?<br>
<pre class="moz-signature" cols="72">--
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</pre>
</body>
</html>