From abb5d23eba21a2aafda0346c0c5dd845561b2aa2 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Thu, 12 Sep 2024 13:55:40 +0200 Subject: function key macros have been reworked into a more generic key macro feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ALL keypresses (the UTF-8 sequences resulting from key presses) can now be remapped. * This is especially useful with Unicode support, as you might want to alias international characters to their corresponding latin form in the start state, so you don't have to change keyboard layouts so often. This is done automatically in Gtk, where we have hardware key press information, but has to be done with key macros in Curses. There is a new key mask 4 (bit 3) for that purpose now. * Also, you might want to define non-ANSI letters to perform special functions in the start state where it won't be accepted by the parser anyway. Suppose you have a macro M→, you could define @^U[^K→]{m→} 1^_U[^K→] This effectively "extends" the parser and allow you to call macro "→" by a single key press. See also #5. * The register prefix has been changed from ^F (for function) to ^K (for key). This is the only thing you have to change in order to migrate existing function key macros. * Key macros are enabled by default. There is no longer any way to disable function key handling in curses, as I never found any reason or need to disable it. Theoretically, the default ESCDELAY could turn out to be too small and function keys don't get through. I doubt that's possible unless on extremely slow serial lines. Even then, you'd have to increase ESCDELAY and instead of disabling function keys simply define an escape surrogate. * The ED flag has been removed and its place is reserved for a future mouse support flag (which does make sense to disable in curses sometimes). fnkeys.tes is consequently also enabled by default in sample.teco_ini. * Key macros are handled as an unit. If one character results in an error, the entire string is rubbed out. This fixes the "CLOSE" key on Gtk. It also makes sure that the original error message is preserved and not overwritten by some subsequent syntax error. It was never useful that we kept inserting characters after the first error. --- sample.teco_ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sample.teco_ini') diff --git a/sample.teco_ini b/sample.teco_ini index dd37376..f0f5208 100644 --- a/sample.teco_ini +++ b/sample.teco_ini @@ -53,8 +53,8 @@ EMQ[$SCITECOPATH]/session.tes The size unit is 1pt/100 ! ! [lexer.font]Monospace 1300U[lexer.font] ! -! Uncomment to enable default keyboard macros and function keys ! -! EMQ[$SCITECOPATH]/fnkeys.tes ! +! Enable default function key macros ! +EMQ[$SCITECOPATH]/fnkeys.tes ! Uncomment if XTerm allows clipboard operations ! ! 0,256ED ! -- cgit v1.2.3