From fffcf07ad73001d83adff5ecfc8ba02a10d20464 Mon Sep 17 00:00:00 2001 From: tmk Date: Tue, 10 Sep 2013 15:31:15 +0900 Subject: [PATCH] Fix tab key focus --- editor/hhkb/index.html | 127 ++++++++++++++++++++++------------------- 1 file changed, 67 insertions(+), 60 deletions(-) diff --git a/editor/hhkb/index.html b/editor/hhkb/index.html index 47659202..52d56474 100644 --- a/editor/hhkb/index.html +++ b/editor/hhkb/index.html @@ -68,6 +68,9 @@ // grey-out key to indicate being under editing $(".key").removeClass("key-editing"); $(this).addClass("key-editing"); + }).focus(function(ev, ui) { + // select editing_key with tab key focus + $(this).click(); }); @@ -89,6 +92,7 @@ }); $(".action").click(function(ev,ui) { + console.log("action click"); if (!editing_key) return; // get matrix position from key id: key-RRCC where RR is row and CC is column in dec @@ -104,6 +108,9 @@ // get code from keycode button id: code-[0x]CC where CC is dec or hex number var code = $(this).attr('id').match(/code-((0x){0,1}[0-9a-fA-F]+)/)[1]; keymaps[editing_layer][row][col] = parseInt(code); + + // give focus on editing_key for next tab key operation + $("#" + editing_key).focus(); }); @@ -228,79 +235,79 @@ See
-
Esc
-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
0
-
-
-
=
-
\
-
`
+
Esc
+
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
0
+
-
+
=
+
\
+
`
-
Tab
-
Q
-
W
-
E
-
R
-
T
-
Y
-
U
-
I
-
O
-
P
-
[
-
]
-
BSpc
+
Tab
+
Q
+
W
+
E
+
R
+
T
+
Y
+
U
+
I
+
O
+
P
+
[
+
]
+
BSpc
-
Ctrl
-
A
-
S
-
D
-
F
-
G
-
H
-
J
-
K
-
L
-
;
-
'
-
Enter
+
Ctrl
+
A
+
S
+
D
+
F
+
G
+
H
+
J
+
K
+
L
+
;
+
'
+
Enter
-
Shift
-
Z
-
X
-
C
-
V
-
B
-
N
-
M
-
,
-
.
-
/
-
Shift
-
Fn
+
Shift
+
Z
+
X
+
C
+
V
+
B
+
N
+
M
+
,
+
.
+
/
+
Shift
+
Fn
-
Sup
-
Alt
-
-
Alt
-
Sup
+
LGui
+
RAlt
+
Space
+
RAlt
+
RGui