- Subject: [jed-users] Re: getkey ()
- From: Morten Bo Johansen <mbj@xxxxxxxxxxx>
- Date: Tue, 22 Aug 2017 15:01:22 +0200
On 2017-08-21 John E. Davis wrote:
> No. `getkey` is a low-level function that returns a character (a byte,
> actually)
But there is also _getkey which is described this way:
"The `_getkey' function may be used to read a byte character from the
keyboard. It should be used instead of `getkey' when
byte-semantics are required."
Since getkey, according to you, also reads by bytes then there
shouldn't be any difference between the two?
But there is: If I type alt-x _getkey and then type 'Æ' then
the second octet of that two byte character is inserted into
the buffer whereas it is not with alt-x getkey
With getkey I suppose the second octet is not bound to the
self_insert_cmd and so nothing happens as one would expect (?)
Well, it is at least mildly confusing. ;-)
The get_keysequence () function does not work for my purposes.
I am trying to make a completion function that is something
like this:
switch (getkey ())
{ case 9: loop over words in completions array one by one }
{ leave the chosen inserted completed word in the buffer and break }
So any other key than TAB should break the loop and leave the
inserted completed word in the buffer, and this is why having
e.g. "OC" inserted when hitting the arrow key is annoying. When
I hit TAB, the get_keysequence () function just jumps to the
last word in the completions array, inserts it into the buffer
and stops the loop.
Morten
_______________________________________________
For list information, visit <http://jedsoft.org/jed/mailinglists.html>.
[2017 date index]
[2017 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]