2048: add vim keys and (hopefully) termux keys!
This commit is contained in:
parent
0fbc2fad75
commit
241be55236
12
lisp/2048.el
12
lisp/2048.el
@ -381,10 +381,22 @@ individually."
|
|||||||
(define-derived-mode 2048-mode fundamental-mode "2048"
|
(define-derived-mode 2048-mode fundamental-mode "2048"
|
||||||
"Major mode for playing 2048 in Emacs."
|
"Major mode for playing 2048 in Emacs."
|
||||||
(random t) ;; Start up the RNG
|
(random t) ;; Start up the RNG
|
||||||
|
;; Arrow keys
|
||||||
(local-set-key (kbd "<left>") '2048-shift-left)
|
(local-set-key (kbd "<left>") '2048-shift-left)
|
||||||
(local-set-key (kbd "<right>") '2048-shift-right)
|
(local-set-key (kbd "<right>") '2048-shift-right)
|
||||||
(local-set-key (kbd "<down>") '2048-shift-down)
|
(local-set-key (kbd "<down>") '2048-shift-down)
|
||||||
(local-set-key (kbd "<up>") '2048-shift-up)
|
(local-set-key (kbd "<up>") '2048-shift-up)
|
||||||
|
;; Vim keys
|
||||||
|
(local-set-key (kbd "h") '2048-shift-left)
|
||||||
|
(local-set-key (kbd "l") '2048-shift-right)
|
||||||
|
(local-set-key (kbd "j") '2048-shift-down)
|
||||||
|
(local-set-key (kbd "k") '2048-shift-up)
|
||||||
|
;; Swipe controls for termux
|
||||||
|
(local-set-key (kbd "<mouse-4>") '2048-shift-left)
|
||||||
|
(local-set-key (kbd "<mouse-5>") '2048-shift-right)
|
||||||
|
(local-set-key (kbd "<mouse-6>") '2048-shift-down)
|
||||||
|
(local-set-key (kbd "<mouse-7>") '2048-shift-up)
|
||||||
|
|
||||||
(2048-startup)
|
(2048-startup)
|
||||||
(setq font-lock-defaults '(2048-highlights))
|
(setq font-lock-defaults '(2048-highlights))
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user