[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Search]

Console keys and emacs



Bart --

This is in response to your question about the console keys
and emacs.

1) you need to load in the keymap via loadkeys --from your
   message it sounded like you had done this.
The above will cause the keys defined in the supplemental
   keympa loaded above to send out appropriate strings.

Confirm that this is happening by entering the scratch
buffer in emacs, and hit C-q followed by the special keys
e.g. shift-tab.

Once you have confirmed this --for instance when I hit C-q
S-tab I get 
"Escape [ t" (note that you will actually get an escape
char)

Once this is done, you still need to tell emacs what
keysyms to bind to these strings e.g. shift-tab to "escape [
t" above.
You'll need to do the above before you can use things like
global-set-key to bind the keysym e.g. S-tab

I usually place these in a file called console.el 
--emacs loads it upon start up when running on the console.
;;; shift tab:
(define-key function-key-map "\033[T" '[S-tab])

--Here is all of my console.el:
;;; Function keymap for linux console:
;;;Following lines taken from lk20.el
;;; Fix some keypad keys:
(global-unset-key "\e\e")
(define-key function-key-map "\e[1~" [find])
(define-key function-key-map "\e[2~" [insert])
(define-key function-key-map "\e[3~" [delete])
(define-key function-key-map "\e[4~" [select])
;;; Function key 11 -- 20
(define-key function-key-map "\e[23~" [f11])
(define-key function-key-map "\e[24~" [f12])
(define-key function-key-map "\e[25~" [f13])
(define-key function-key-map "\e[26~" [f14])
(define-key function-key-map "\e[28~" [help])
(define-key function-key-map "\e[29~" [menu])
(define-key function-key-map "\e[31~" [f17])
(define-key function-key-map "\e[32~" [f18])
(define-key function-key-map "\e[33~" [f19])
(define-key function-key-map "\e[34~" [f20])

;;; And finally handle the keypad keys:

(define-key function-key-map "\eOP" [kp-f1])
(define-key function-key-map "\eOQ" [kp-f2])
(define-key function-key-map "\eOR" [kp-f3])
(define-key function-key-map "\eOS" [kp-f4])

(define-key function-key-map "\eOI" [kp-tab])
(define-key function-key-map "\eOj" [kp-multiply])
(define-key function-key-map "\eOk" [kp-add])
(define-key function-key-map "\eOl" [kp-separator])
(define-key function-key-map "\eOM" [kp-enter])
(define-key function-key-map "\eOm" [kp-subtract])
(define-key function-key-map "\eOn" [kp-decimal])
(define-key function-key-map "\eOo" [kp-divide])
(define-key function-key-map "\eOp" [kp-0])
(define-key function-key-map "\eOq" [kp-1])
(define-key function-key-map "\eOr" [kp-2])
(define-key function-key-map "\eOs" [kp-3])
(define-key function-key-map "\eOt" [kp-4])
(define-key function-key-map "\eOu" [kp-5])
(define-key function-key-map "\eOv" [kp-6])
(define-key function-key-map "\eOw" [kp-7])
(define-key function-key-map "\eOx" [kp-8])
(define-key function-key-map "\eOy" [kp-9])
;;; shift arrows

(define-key function-key-map  "\e[E" '[S-up])
   (define-key function-key-map "\e[F" '[S-down])
   (define-key function-key-map "\e[G" '[S-right])
   (define-key function-key-map "\e[H" '[S-left])
;;; Get control arrows:

(define-key function-key-map "\e[I" '[C-up])
(define-key function-key-map  "\e[J" '[C-down])
(define-key function-key-map "\e[K" '[C-right])
(define-key function-key-map "\e[L" '[C-left])
;;; shift tab:
(define-key function-key-map "\033[T" '[S-tab])

-- 
Best Regards,
--raman

      
Email:  raman@xxxxxxxxxxx
WWW:    http://cs.cornell.edu/home/raman/             
PGP:    http://cs.cornell.edu/home/raman/raman.asc 

-----------------------------------------------------------------------------
To unsubscribe from the emacspeak list or change your address on the
emacspeak list send mail to "emacspeak-request@xxxxxxxxxxx" with a
subject of "unsubscribe" or "help"


Emacspeak Files | Subscribe | Unsubscribe