jed-users mailing list

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

Re: [jed-users] different terminal modes and key escape sequences?


In KDE Neon, when I type "export" at the terminal, one of the variables which pops up is:

declare -x KONSOLE_PROFILE_NAME="Profile 5"

Sadly, this variable is set even if I'm in Yaquake but, if you are always using Konsole on Linux and whatever on the worthless Windows platform, it's enough of a hack for you.

It will work for a few years until Microsoft finishes its abandonment of Windows, replacing it under the hood completely with what we now know as Ubuntu Linux. Canonical is in the process of abandoning Linux for Fuchsia and Google is in the process of abandoning Android for their own fork of Fuchsia so for the next 3 years, everything written will be throw away code on the x86 and ARM.


On 09/28/2017 02:45 AM, Guenter Milde wrote:
On 27.09.17, Ryan Swan wrote:

    I'm trying to either detect which mode I'm in, or have some keys to
    switch the escape sequences sent for keyboard values. For example,
    in Konsole term=LINUX, the ctrl+right key is  Key_Ctrl_Right =
    "\E[5C"; But in bash.exe, the Windows 10 Bash Subsystem
    Key_Ctrl_Right = "\e[1;5C"; I'd like to have the same .jedrc file,
    and either press a keystroke or ideally have this difference be
    auto-detectable, and appropriately settable.
    I tried this and it didn't work:
...

    setkey ("keyboard1", "\eT");
    setkey ("keyboard2", "\eY");
"setkey()" is used to bind a function/action to a character sequence in
the input stream. This is used to bind the same key sequence to mode
dependent actions (e.g. email mode vs. C mode).

What you seem to be interested in is to make Jed aware of the different
mappings of keypresses to key sequences.

For this, the keydefs.sl defines the "key string variables" like
Key_Ctrl_Right and tries to get this automatically correct for xjed vs. jed
on windows vs. the different terminal emulations.

The file x-keydefs.sl (http://jedmodes.sf.net/mode/x-keydefs) extends the
set of Key_* variables and sets them up for xjed.

In case the automatism fails, you can change the variable values in your
jed.rc file, e.g.

#ifdef IBMPC_SYSTEM
   Key_Ctrl_Right = "\e[1;5B"
#endif

If you cannot find a way to auto-detect the environment, you can define
functions to change a set of Key_* variable values.


To find out the character sequence send by a key, you may use a function
similar to:

public define showkey_literal()
{
    flush ("Press key:");
    variable key = get_keystring();
    if (prefix_argument(0))
      insert (key);
    else
      {
#ifdef XWINDOWS
	key += sprintf(" X-Keysym: 0x%04X", X_LAST_KEYSYM);
#endif
	message ("Key sends " + key);
      }
}


Günter
_______________________________________________
For list information, visit <http://jedsoft.org/jed/mailinglists.html>.


--
Roland Hughes, President
Logikal Solutions
(630)-205-1593

http://www.theminimumyouneedtoknow.com
http://www.infiniteexposure.net
http://www.johnsmith-book.com
http://www.logikalblog.com
http://www.interestingauthors.com/blog
http://lesedi.us/
http://onedollarcontentstore.com


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