[ENH] Alternative EventSensor

Stephan Rudlof sr at evolgo.de
Mon Jul 31 01:23:06 UTC 2000


Ned Konz wrote:
> 
> Dan Ingalls wrote:
> 
> > >I find the VM's mapping of keys to be a weak spot of the current implementation.
> > >There are a number of keys I just can't use, or that don't work the way I'd like
> > >(for instance, I don't seem to have a forward delete key in Squeak).
> >
> > Ctrl-delete gives you forward-delete (on the Mac, at least), as per (screen-menu / help... / command-key help).  Its undo happens to be broken, though, in case anyone wants to fix it [I'm guilty -- put it in a couple of years ago when I didn't understand how the ParagraphEditor handles undo (still don't ;-)].
> 
> Well, yes it does!
> 
> However, I already have a forward delete key that I'm used to using (separate
> from my
> backspace key), and it wants to do the same thing as my backspace key.
> 
> (I'm using the Linux version of Squeak).
> 
> There is some suspicious code in sqXWindow.c, inside recordKeystroke that does
> this:
> 
>   if (keystate == 127)
>     keystate= 8;
> 
> In other words, if the key is Del (127), make it a backspace (8).
> 
> I suspect this is here because there is no hard and fast standard under Unix
> for what a Delete key emits (or the keypad DEL key either).

The definition for ASCII says, that
8 -> BS, and
127 -> DEL.

> Because of this, different people have their keyboards emit different
> characters.
> Some people have their backspace key output 127, while others have it output 8.
> And the Delete key generally outputs the other key value.
> 
> For that matter, the keypad DEL key often outputs yet another code. It's pretty
> ugly.

I think we should rely onto the standard here.

> But XWindows is ugly anyway (and Unix GUIs are nowhere near consistent...).
> 
> I personally feel that the best place to handle this is in the X resources for
> the program (or perhaps with yet another command line switch?).

I'd prefer a line switch, if necessary (means: somebody wants to have one):
This should be more platform independent as an X resource file.

> I'm going to remove those two little lines in my version, and suggest to the
> Unix VM folks that we consider an alternative (for those of us who already
> have the CORRECT keyboard mapping [1]).

Probably we need some changes in the ST code, too, to handle the 'new' key
code; isn't it?

> [1] That is: the big key above the Return key (which on my (but not every)
> keyboard
> is labeled "Delete"))

?

for me it is labeled '<---'...

> emits an 8,

BS,

> and the Del key emits a 127.

How it is labeled at your keyboard?


Stephan
-- 
Stephan Rudlof (sr at evolgo.de)
   "Genius doesn't work on an assembly line basis.
    You can't simply say, 'Today I will be brilliant.'"
    -- Kirk, "The Ultimate Computer", stardate 4731.3





More information about the Squeak-dev mailing list