Loading ...
Sorry, an error occurred while loading the content.

461Re: [jasspa] Detecting NumLock key press?

Expand Messages
  • Jon Green
    Oct 11, 2001
      sonicdaddy@... wrote:
      > QUESTION: Can JASSPA's UEMACS detect when the NumLock key is pressed?

      jon@... replies:-

      Not sure if anybody has asked for this.

      No the feature that you asked for is not currently supported.
      After a quick 10 minute hack then the following will provide
      you with a solution (hopefully I have not broken anything -
      but I'm pressed for time on some other work at the moment.)

      You requested Windows, I've not tested this or looked at
      these modifications in UNIX space. Changes as follows
      against the "MicroEmacs 01 - Date 01/08/01 - win32"
      version of source code.

      Changes follow (CVS Diff format), simply apply
      and re-build (also attached incase yahoo groups
      messes up the text format). The keys that I have
      added are:-

      capslock
      numlock
      pause
      scroll

      These are all by default bound to "void" i.e.
      they will not do anything. If you look at

      M-x describe-bindings

      then the keys are present but unbound. You
      can then bind these kesy (i.e. numlock) globally
      to some operation (i.e. next-buffer) using:-

      M-x global-bind-key next-buffer "numlock"

      Set all of these up in your <user>.emf

      Regards
      Jon.

      --

      cvs diff ebind.def eskeys.def winterm.c

      Index: ebind.def
      ===================================================================
      RCS file: /export/cvs/me/src/ebind.def,v
      retrieving revision 2.1
      diff -r2.1 ebind.def
      9c9
      < * Last Modified : <010804.1624>
      ---
      > * Last Modified : <011011.1900>
      64a65
      > DEFBIND (ME_SPECIAL|SKEY_capslock, 0, CK_VOIDFUNC)
      81a83
      > DEFBIND (ME_SPECIAL|SKEY_numlock, 0, CK_VOIDFUNC)
      83a86
      > DEFBIND (ME_SPECIAL|SKEY_pause, 0, CK_VOIDFUNC)
      86a90
      > DEFBIND (ME_SPECIAL|SKEY_scroll, 0, CK_VOIDFUNC)
      Index: eskeys.def
      ===================================================================
      RCS file: /export/cvs/me/src/eskeys.def,v
      retrieving revision 2.0
      diff -r2.0 eskeys.def
      9c9
      < * Last Modified : <000718.2344>
      ---
      > * Last Modified : <011011.1900>
      29a30
      > DEFSKEY ("capslock", NULL, NULL, SKEY_capslock )
      97a99
      > DEFSKEY ("numlock", NULL, NULL, SKEY_numlock )
      99a102
      > DEFSKEY ("pause", NULL, NULL, SKEY_pause )
      103a107
      > DEFSKEY ("scroll", NULL, NULL, SKEY_scroll )
      Index: winterm.c
      ===================================================================
      RCS file: /export/cvs/me/src/winterm.c,v
      retrieving revision 2.4
      diff -r2.4 winterm.c
      3026c3026,3040
      < case VK_APPS:
      ---
      > /* BEGIN JON HACK - Special keys requested by somebody !! */
      > case VK_NUMLOCK:
      > cc = SKEY_numlock ;
      > goto do_keydown;
      > case VK_CAPITAL:
      > cc = SKEY_capslock ;
      > goto do_keydown;
      > case VK_SCROLL:
      > cc = SKEY_scroll ;
      > goto do_keydown;
      > case VK_PAUSE:
      > cc = SKEY_pause ;
      > goto do_keydown;
      > /* END JON HACK - Special keys requested by somebody !! */
      > case VK_APPS:

      --
    • Show all 2 messages in this topic