@@ -8,8 +8,10 @@ import (
8
8
"log"
9
9
"machine"
10
10
"machine/usb"
11
+ "time"
11
12
12
13
keyboard "github.com/sago35/tinygo-keyboard"
14
+ "github.com/sago35/tinygo-keyboard/keycodes"
13
15
jp "github.com/sago35/tinygo-keyboard/keycodes/japanese"
14
16
"tinygo.org/x/drivers/ssd1306"
15
17
"tinygo.org/x/tinydraw"
36
38
)
37
39
38
40
func run () error {
41
+ //time.Sleep(3 * time.Second)
42
+
39
43
i2c .Configure (machine.I2CConfig {
40
44
Frequency : machine .TWI_FREQ_400KHZ ,
41
45
SCL : sclPin ,
@@ -67,7 +71,7 @@ func run() error {
67
71
68
72
mk := d .AddMatrixKeyboard (colPins , rowPins , [][]keyboard.Keycode {
69
73
{
70
- jp . KeyT , jp . KeyI , jp . KeyN ,
74
+ keycodes . KeyMacro0 , keycodes . KeyMacro1 , keycodes . KeyMacro2 ,
71
75
jp .KeyY , jp .KeyG , jp .KeyO ,
72
76
},
73
77
})
@@ -80,6 +84,27 @@ func run() error {
80
84
}
81
85
})
82
86
87
+ d .SetMacro (0 ,
88
+ "macro0" ,
89
+ time .Duration (3 * time .Millisecond ),
90
+ keyboard .Keycode (jp .KeyA ),
91
+ jp .KeyB ,
92
+ keyboard .MacroDown (jp .KeyB ),
93
+ time .Duration (1000 * time .Millisecond ),
94
+ keyboard .MacroUp (jp .KeyB ),
95
+ )
96
+ d .SetMacro (1 ,
97
+ "macro1" ,
98
+ )
99
+ d .SetMacro (2 ,
100
+ jp .KeyM ,
101
+ jp .KeyA ,
102
+ jp .KeyC ,
103
+ jp .KeyR ,
104
+ jp .KeyO ,
105
+ jp .Key3 ,
106
+ )
107
+
83
108
go func () {
84
109
for {
85
110
select {
0 commit comments