mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-06 02:30:42 -08:00
add :key attribute to keyboard event data
Adding :key attribute makes it easy to handle keypresses. That's because we don't need to do any conversions using code-char.
This commit is contained in:
parent
93389b5558
commit
6b6b9a487b
1 changed files with 3 additions and 2 deletions
|
|
@ -254,7 +254,7 @@ result or if time out DEFAULT-ANSWER (Private)"))
|
|||
|
||||
(defparameter keyboard-event-script
|
||||
"+ e.keyCode + ':' + e.charCode + ':' + e.altKey + ':' + e.ctrlKey + ':' +
|
||||
e.shiftKey + ':' + e.metaKey"
|
||||
e.shiftKey + ':' + e.metaKey + ':' + e.key"
|
||||
"JavaScript to collect keyboard event data from browser.")
|
||||
|
||||
(defun parse-keyboard-event (data)
|
||||
|
|
@ -266,7 +266,8 @@ result or if time out DEFAULT-ANSWER (Private)"))
|
|||
:alt-key (js-true-p (nth 2 f))
|
||||
:ctrl-key (js-true-p (nth 3 f))
|
||||
:shift-key (js-true-p (nth 4 f))
|
||||
:meta-key (js-true-p (nth 5 f)))))
|
||||
:meta-key (js-true-p (nth 5 f))
|
||||
:key (nth 6 f))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; parse-drop-event ;;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue