slang-users mailing list

[2004 Date Index] [2004 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [slang-users] Reconstructing the last key sequence


Hi Thomas,

>In a few places, slrn tries to find out what key the user pressed to
>trigger a function. For this, it currently uses the variable
>SLang_Last_Key_Char.
>
>However, this does not work when the function is bound to a key sequence
>(like the ANSI sequences for special function keys). Is there any
>canonical way to get the full key sequence that triggered the last keymap
>entry?


There is no simple function that returns this information.  However,
you do have a couple of methods that may be used to discover this
information:

1.  Assuming that you know the function that the key sequence executed
    and the keymap, then you could do a reverse lookup on the keymap.
    The jed function which_key, defined in jed/src/keymap.c takes this
    approach.
    
2.  slang/src/slcurses.c performs its own buffering of keys so that it
    can distinguish the ESC key and a key sequence that begins with ESC.

Adapting 2 may require more work than simply using jed's which_key
function.

I hope this helps.
Thanks,
--John

   

_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html


[2004 date index] [2004 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]