utoddl
unread,Oct 19, 2012, 10:51:37 PM10/19/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nicee...@googlegroups.com
There's no standard way to tell a terminal that you had the Ctrl key pressed when you hit a cursor key. All that comes across the wire is a sequence of bytes. In this case, the sequence your terminal is creating in response to Ctrl-Up is an Esc character followed by a left bracket, the digit 1, a colon, the digit 5, then a capital A. Ctrl-Down is the same except it ends with a B instead of an A.
Ne is seeing the first escape character, and what follows doesn't match any defined sequence, so it takes the escape as a single character which brings up or cancels the menu. The rest of the characters come across as individual characters as well, and they end up in your document.
What you need to do is to define the sequence of bytes generated by these keystrokes, bind them to one of ne's virtual "keys", then bind that key to a command, in this case the "Escape" command. The way you do this is to create (or modify if it already exists) a ~/.ne/.keys file to contain the following lines:
# Ctrl-Up
SEQ "\x1b[1;5A" 20
# Ctrl-Down
SEQ "\x1b[1;5B" 20
# Ctrl-Right
SEQ "\x1b[1;5C" 20
# Ctrl-Left
SEQ "\x1b[1;5D" 20
KEY 20 Escape
The "SEQ" statements will map each of the escape sequences that your terminal generates for Ctrl-<cursor> combinations to ne's virtual key #20. The final "KEY" statement binds key 20 to the Escape command. (That's the command normally bound to the Esc key.) It essentially turns all your Ctrl-<cursor> keys into Escape commands, which bring up or cancel the menus.
If I understand what you're trying to do, this should solve your problem.
--
Todd