Fix return keymap to 0
No longer attempts to change keymap when there is only one Fixed typo in keymap
This commit is contained in:
parent
f882f599ff
commit
2697df4352
@ -81,11 +81,11 @@
|
|||||||
},
|
},
|
||||||
"": {
|
"": {
|
||||||
"modifier": ["LSHIFT"],
|
"modifier": ["LSHIFT"],
|
||||||
"decimal": 46
|
"decimal": 45
|
||||||
},
|
},
|
||||||
"": {
|
"": {
|
||||||
"modifier": ["LSHIFT"],
|
"modifier": ["LSHIFT"],
|
||||||
"decimal": 45
|
"decimal": 46
|
||||||
},
|
},
|
||||||
"": {
|
"": {
|
||||||
"modifier": ["NONE"],
|
"modifier": ["NONE"],
|
||||||
|
7
main.go
7
main.go
@ -47,13 +47,15 @@ func Hold(press [8]byte, file io.Writer) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func keymapto0(args Args, hidg0 *os.File, currentKeyMap *int) {
|
func keymapto0(args Args, hidg0 *os.File, currentKeyMap *int) {
|
||||||
|
if len(args.ORDER) > 1 {
|
||||||
for i := 0; i <= len(args.ORDER)-(*currentKeyMap+1); i++ {
|
for i := 0; i < len(args.ORDER)-(*currentKeyMap); i++ {
|
||||||
Press([8]byte{LALT, 0x00, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00}, hidg0)
|
Press([8]byte{LALT, 0x00, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00}, hidg0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func changeKeymap(r rune, keys map[string]Keys, args Args, hidg0 *os.File, currentKeyMap *int) {
|
func changeKeymap(r rune, keys map[string]Keys, args Args, hidg0 *os.File, currentKeyMap *int) {
|
||||||
|
if len(args.ORDER) > 1 {
|
||||||
for i := 0; i < len(args.ORDER); i++ {
|
for i := 0; i < len(args.ORDER); i++ {
|
||||||
if keys[args.ORDER[(*currentKeyMap)]][string(r)].Decimal == 0 {
|
if keys[args.ORDER[(*currentKeyMap)]][string(r)].Decimal == 0 {
|
||||||
Press([8]byte{LALT, 0x00, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00}, hidg0)
|
Press([8]byte{LALT, 0x00, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00}, hidg0)
|
||||||
@ -68,6 +70,7 @@ func changeKeymap(r rune, keys map[string]Keys, args Args, hidg0 *os.File, curre
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
var (
|
var (
|
||||||
|
Loading…
Reference in New Issue
Block a user