From 3e0ac28943c163d06c9c5345e419640ee141a8fc Mon Sep 17 00:00:00 2001 From: vcaesar Date: Tue, 23 Nov 2021 16:19:46 -0400 Subject: [PATCH] Update keycode.go use the newest code --- appveyor.yml | 2 +- go.mod | 5 ++- go.sum | 2 + keycode.go | 102 +++------------------------------------------------ 4 files changed, 13 insertions(+), 98 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 34b711f..70c124c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -34,7 +34,7 @@ environment: PATH: C:\msys64\mingw32\bin\;C:\Program Files (x86)\NSIS\;%PATH% # - COMPILER: MINGW_W64 # ARCHITECTURE: x64 - GOVERSION: 1.17.2 + GOVERSION: 1.17.3 # GOPATH: c:\gopath # scripts that run after cloning repository diff --git a/go.mod b/go.mod index d55c838..c688876 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,7 @@ module github.com/robotn/gohook go 1.17 -require github.com/vcaesar/tt v0.20.0 +require ( + github.com/vcaesar/keycode v0.10.0 + github.com/vcaesar/tt v0.20.0 +) diff --git a/go.sum b/go.sum index b3cb17f..fa34337 100644 --- a/go.sum +++ b/go.sum @@ -1,2 +1,4 @@ +github.com/vcaesar/keycode v0.10.0 h1:Qx5QE8ZXHyRyjoA2QOxBp25OKMKB+zxMVqm0FWGV0d4= +github.com/vcaesar/keycode v0.10.0/go.mod h1:JNlY7xbKsh+LAGfY2j4M3znVrGEm5W1R8s/Uv6BJcfQ= github.com/vcaesar/tt v0.20.0 h1:9t2Ycb9RNHcP0WgQgIaRKJBB+FrRdejuaL6uWIHuoBA= github.com/vcaesar/tt v0.20.0/go.mod h1:GHPxQYhn+7OgKakRusH7KJ0M5MhywoeLb8Fcffs/Gtg= diff --git a/keycode.go b/keycode.go index 1db0925..d1ccd2e 100644 --- a/keycode.go +++ b/keycode.go @@ -10,103 +10,13 @@ package hook -type uMap map[string]uint16 +import "github.com/vcaesar/keycode" // MouseMap robotgo hook mouse's code map -var MouseMap = uMap{ - "left": 1, - "right": 2, - "center": 3, - "wheelDown": 4, - "wheelUp": 5, - "wheelLeft": 6, - "wheelRight": 7, -} +var MouseMap = keycode.MouseMap // Keycode robotgo hook key's code map -var Keycode = uMap{ - "`": 41, - "1": 2, - "2": 3, - "3": 4, - "4": 5, - "5": 6, - "6": 7, - "7": 8, - "8": 9, - "9": 10, - "0": 11, - "-": 12, - "+": 13, - // - "q": 16, - "w": 17, - "e": 18, - "r": 19, - "t": 20, - "y": 21, - "u": 22, - "i": 23, - "o": 24, - "p": 25, - "[": 26, - "]": 27, - "\\": 43, - // - "a": 30, - "s": 31, - "d": 32, - "f": 33, - "g": 34, - "h": 35, - "j": 36, - "k": 37, - "l": 38, - ";": 39, - "'": 40, - // - "z": 44, - "x": 45, - "c": 46, - "v": 47, - "b": 48, - "n": 49, - "m": 50, - ",": 51, - ".": 52, - "/": 53, - // - "f1": 59, - "f2": 60, - "f3": 61, - "f4": 62, - "f5": 63, - "f6": 64, - "f7": 65, - "f8": 66, - "f9": 67, - "f10": 68, - "f11": 69, - "f12": 70, - // more - "esc": 1, - "delete": 14, - "tab": 15, - "ctrl": 29, - "control": 29, - "alt": 56, - "space": 57, - "shift": 42, - "rshift": 54, - "enter": 28, - // - "cmd": 3675, - "command": 3675, - "rcmd": 3676, - "ralt": 3640, - // - "up": 57416, - "down": 57424, - "left": 57419, - "right": 57421, -} +var Keycode = keycode.Keycode + +// Special is the special key map +var Special = keycode.Special