add super key (vmware builder)

This commit is contained in:
Andrew Pennebaker 2017-12-07 23:15:56 -06:00
parent 201b9a21e0
commit 4acc98a729
1 changed files with 46 additions and 0 deletions

View File

@ -183,6 +183,8 @@ func vncSendString(c *vnc.ClientConn, original string) {
special["<rightAlt>"] = 0xFFEA
special["<rightCtrl>"] = 0xFFE4
special["<rightShift>"] = 0xFFE2
special["<leftSuper>"] = 0xFFEB
special["<rightSuper>"] = 0xFFEC
shiftedChars := "~!@#$%^&*()_+{}|:\"<>?"
@ -231,6 +233,17 @@ func vncSendString(c *vnc.ClientConn, original string) {
continue
}
if strings.HasPrefix(original, "<leftSuperOn>") {
keyCode = special["<leftSuper>"]
original = original[len("<leftSuperOn>"):]
log.Printf("Special code '<leftSuperOn>' found, replacing with: %d", keyCode)
c.KeyEvent(keyCode, true)
time.Sleep(keyInterval)
continue
}
if strings.HasPrefix(original, "<leftAltOff>") {
keyCode = special["<leftAlt>"]
original = original[len("<leftAltOff>"):]
@ -264,6 +277,17 @@ func vncSendString(c *vnc.ClientConn, original string) {
continue
}
if strings.HasPrefix(original, "<leftSuperOff>") {
keyCode = special["<leftSuper>"]
original = original[len("<leftSuperOff>"):]
log.Printf("Special code '<leftSuperOff>' found, replacing with: %d", keyCode)
c.KeyEvent(keyCode, false)
time.Sleep(keyInterval)
continue
}
if strings.HasPrefix(original, "<rightAltOn>") {
keyCode = special["<rightAlt>"]
original = original[len("<rightAltOn>"):]
@ -297,6 +321,17 @@ func vncSendString(c *vnc.ClientConn, original string) {
continue
}
if strings.HasPrefix(original, "<rightSuperOn>") {
keyCode = special["<rightSuper>"]
original = original[len("<rightSuperOn>"):]
log.Printf("Special code '<rightSuperOn>' found, replacing with: %d", keyCode)
c.KeyEvent(keyCode, true)
time.Sleep(keyInterval)
continue
}
if strings.HasPrefix(original, "<rightAltOff>") {
keyCode = special["<rightAlt>"]
original = original[len("<rightAltOff>"):]
@ -330,6 +365,17 @@ func vncSendString(c *vnc.ClientConn, original string) {
continue
}
if strings.HasPrefix(original, "<rightSuperOff>") {
keyCode = special["<rightSuper>"]
original = original[len("<rightSuperOff>"):]
log.Printf("Special code '<rightSuperOff>' found, replacing with: %d", keyCode)
c.KeyEvent(keyCode, false)
time.Sleep(keyInterval)
continue
}
if strings.HasPrefix(original, "<wait>") {
log.Printf("Special code '<wait>' found, sleeping one second")
time.Sleep(1 * time.Second)