123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- (defvar vt-applications-keypad-p t
- "If non-nil, keypad is in applications mode.")
- (defvar vt-wide-p nil
- "If non-nil, the screen is 132 characters wide.")
- (defun vt-wide nil
- "Set the screen 132 characters wide."
- (interactive)
- (send-string-to-terminal "\e[?3h")
- (set-frame-width (selected-frame) 132)
- (setq vt-wide-p t))
- (defun vt-narrow nil
- "Set the screen 80 characters wide."
- (interactive)
- (send-string-to-terminal "\e[?3l")
- (set-frame-width (selected-frame) 80)
- (setq vt-wide-p nil))
- (defun vt-toggle-screen nil
- "Toggle between 80 and 132 character screen width."
- (interactive)
- (if vt-wide-p (vt-narrow) (vt-wide)))
- (defun vt-keypad-on (&optional tell)
- "Turn on the VT applications keypad."
- (interactive)
- (send-string-to-terminal "\e=")
- (setq vt-applications-keypad-p t)
- (if (or tell (called-interactively-p 'interactive))
- (message "Applications keypad enabled.")))
- (defun vt-keypad-off (&optional tell)
- "Turn off the VT applications keypad."
- (interactive "p")
- (send-string-to-terminal "\e>")
- (setq vt-applications-keypad-p nil)
- (if (or tell (called-interactively-p 'interactive))
- (message "Applications keypad disabled.")))
- (defun vt-numlock nil
- "Toggle VT application keypad on and off."
- (interactive)
- (if vt-applications-keypad-p
- (vt-keypad-off (called-interactively-p 'interactive))
- (vt-keypad-on (called-interactively-p 'interactive))))
- (provide 'vt-control)
|