Help! Need keyboard advice...

1 view
Skip to first unread message

Gary

unread,
Jul 26, 2009, 3:43:06 PM7/26/09
to OpenQM-OpenSource
Perhaps someone has already dealt with a similar issue and can make a
suggestion. When at an INPUT@ or INPUTFIELD@ statement, I want the
END key to break, save the existing changes (ala KEYEXIT rather than
KEYTRAP) and exit with a status code that I can read. Does anyone
have an idea about how I can do this? I've tried several methods, but
have yet to find one that works.

Thanks,

GaryW

Gary

unread,
Jul 31, 2009, 12:03:29 PM7/31/09
to OpenQM-OpenSource
After much experimentation, I have solved the problem.

Thanks anyway,

GaryW

Tom Potts

unread,
Jul 31, 2009, 12:17:25 PM7/31/09
to openqm-o...@googlegroups.com
What did you do in the end, can I ask?

Tom

2009/7/31 Gary <gwal...@gmail.com>

Gary

unread,
Aug 1, 2009, 8:11:15 AM8/1/09
to OpenQM-OpenSource
On Jul 31, 12:17 pm, Tom Potts <karake...@gmail.com> wrote:
> What did you do in the end, can I ask?
>
> Tom
>
> 2009/7/31 Gary <gwalb...@gmail.com>
>
>
>
> > After much experimentation, I have solved the problem.
>
> > Thanks anyway,
>
> > GaryW

Tom,
In the code where I want this to happen, I remapped the 'End' key
to 'User0' thus:

CURR.END.KEY=TERMINFO("kend")
VOID BINDKEY(CURR.END.KEY,USER0)

where USER0 is defined to be 218

So now it is not used by INPUTFIELD@ or INPUT@ for editing and
returns 218 as a keycode. Then, when INPUTFIELD@ exits, I test for
keycode 218 (USER0) to see if my user pressed 'End'. You can restore
the 'End' key when you are done if you want to avoid breaking other
code.

GaryW

Diccon

unread,
Aug 5, 2009, 7:27:24 AM8/5/09
to OpenQM-OpenSource
Blimey, inventive. Well done.
Should really wiki this, I'll chuck it up if I get time...ever :D
-Diccon
Reply all
Reply to author
Forward
0 new messages