jed-users mailing list

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

Re: gold key for edt mode


Hi John, Guenter,

I did more tests to find out about the gold key. It is a long
story and I hope someone can confirm what I see.

Several tests with Johns edt.sl from the www.jedsoft.org/test/

On WindowsXP:

1. jed.rc:
   () = evalfile("emacs");           % Emacs-like bindings
   setkey ("showkey", "^]");         % Ctrl-]
%   NUMLOCK_IS_GOLD = 0;
   () = evalfile("edt-john");             % EDT emulation

Pressing ^] Numlock gives: Key "GOLD" runs the S-Lang function "edt_line".
So: Numlock send "\eOp" (lower case!) -> bound to edt_line
I do not understand this... Certainly wrong.
---

2. jed.rc:
   () = evalfile("emacs");           % Emacs-like bindings
   setkey ("showkey", "^]");         % Ctrl-]
   NUMLOCK_IS_GOLD = 0;
   () = evalfile("edt-john");             % EDT emulation

Pressing ^] Numlock gives: Key "GOLD" runs the S-Lang function "edt_line".
So: the same problem.
---

3. jed.rc:
   () = evalfile("emacs");           % Emacs-like bindings
   setkey ("showkey", "^]");         % Ctrl-]
   NUMLOCK_IS_GOLD = 1;
   () = evalfile("edt-john");             % EDT emulation

Pressing ^] Numlock TWICE gives: Key "GOLD GOLD" runs the S-Lang function
         "edt_togglekp".
So: that is correct. So I do it and I see the message "GOLD OFF"
Doing it again has no effect (should have given "GOLD ON").
So "edt_togglekp" does not work.
This is not quite what you want because typing on the keypad will insert
numbers 0-9 into the buffer and it is not easy to switch back.
(you can do it via esc-x edt_togglekp)

-------------

On a Putty terminal (or on TeraTerm) connected to a Linux host:
I can not put some line with NUMLOCK_IS_GOLD in, because that
variable is undefined. So I test:

4. jed.rc:
   () = evalfile("emacs");           % Emacs-like bindings
   setkey ("showkey", "^]");         % Ctrl-]
%   NUMLOCK_IS_GOLD = 0;
   () = evalfile("edt-john");             % EDT emulation

Pressing ^] Numlock TWICE gives: Key "GOLD GOLD" runs the S-Lang function
         "edt_togglekp".
So: that is correct. So I do it and I see the message "GOLD OFF"
Doing it again has no effect (should have given "GOLD ON").
Same as above: "edt_togglekp" does not work.

----------

On a Putty terminal (or on TeraTerm) connected to a Linux host:

5. jed.rc:
   () = evalfile("emacs");           % Emacs-like bindings
   setkey ("showkey", "^]");         % Ctrl-]
   variable Key_Gold = Key_F12;
   () = evalfile("edt-john.sl");             % EDT emulation

Pressing ^] F12 TWICE gives: Key "ESC [ 2 4 ~ ESC [ 2 4 ~" runs the S-Lang
         function "edt_togglekp".
So: that is correct. So I do it and I see the message "Numeric"
Doing it again has the right effect, I see the message "Application"

Pressing ^] Numlock gives Key "GOLD" runs the S-Lang function "edt_line".
So: Numlock send "\eOp" (lower case!) -> bound to edt_line
I do not understand this... Certainly wrong.

===========

So there are two kinds of problems:
A. edt_togglekp can not be executed by the Numlock key. (windows&linux)
   So do not bind this function to Numlock.

B. The Numlock key starts to send something different (\eOp) once
   I define a different Key_Gold. That I do not understand.

This is the reason why I modified the lines at the beginning of Johns
edt.sl file. With my modification below, these problems are avoided.


#ifdef IBMPC_SYSTEM
!if (is_defined ("NUMLOCK_IS_GOLD"))
  eval ("variable NUMLOCK_IS_GOLD = 0;");
if (NUMLOCK_IS_GOLD)
  custom_variable ("Key_Gold", "^@;");  %  IBM F1 key
else
  custom_variable ("Key_Gold", "\eOP"); %  VTxxx PF1 key
#else
!if (is_defined ("Key_Gold"))
  custom_variable ("Key_Gold", "\eOP");
#endif
if ((Key_Gold == NULL) or (Key_Gold == "") or (Key_Gold == "\eOP"))
  Key_Gold = "\eOP";
else {
  unsetkey(Key_Gold);
  setkey("kbd_quit", "\eOP");           %  make sure \eOP is bound
}


With the following lines at the very beginning of my edt.sl

#ifnexists Key_Gold
variable Key_Gold = Key_KP_7;   % seems a good choice on all operating systems
#else
setkey("edt_page", Key_KP_7);   %% page (FormFeed delimited pages ...)
#endif

I choose the new Gold key, just in case there is nothing defined
in jed.rc. A side effect is that Numlock will be bound to a harmless function "kbd_quit" and I do not see the "\eOp" anymore.


         Thei.

+-------------------------------------------------------------------+
| T.A.M. Wijnen       see also    www.hef.ru.nl/~thei/JED/
+-------------------------------------------------------------------+


--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


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