mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-05-31 06:13:55 +00:00
Merge pull request #474 from go-vgo/bitmap-pr
Add capital letter key define and events listen test html
This commit is contained in:
commit
ffa27a50cc
37
examples/index.html
Normal file
37
examples/index.html
Normal file
@ -0,0 +1,37 @@
|
||||
<h1>Type and check the console</h1>
|
||||
|
||||
<script>
|
||||
window.onclick = function(events) {
|
||||
console.log({
|
||||
event: "click",
|
||||
altKey: events.altKey,
|
||||
shiftKey: events.shiftKey
|
||||
});
|
||||
};
|
||||
|
||||
window.onkeydown = function(events) {
|
||||
console.log({
|
||||
event: "keydown",
|
||||
key: events.key,
|
||||
keyCode: events.keyCode,
|
||||
keyChar: events.charCode
|
||||
});
|
||||
};
|
||||
|
||||
window.onkeyup = function(events) {
|
||||
console.log({
|
||||
event: "keyup",
|
||||
key: events.key,
|
||||
keyCode: events.keyCode,
|
||||
keyChar: events.charCode
|
||||
});
|
||||
};
|
||||
|
||||
window.onmousemove = function(events) {
|
||||
console.log({
|
||||
event: "move",
|
||||
x: events.x,
|
||||
y: events.y
|
||||
});
|
||||
}
|
||||
</script>
|
27
key.go
27
key.go
@ -59,6 +59,33 @@ const (
|
||||
KeyY = "y"
|
||||
KeyZ = "z"
|
||||
//
|
||||
CapA = "A"
|
||||
CapB = "B"
|
||||
CapC = "C"
|
||||
CapD = "D"
|
||||
CapE = "E"
|
||||
CapF = "F"
|
||||
CapG = "G"
|
||||
CapH = "H"
|
||||
CapI = "I"
|
||||
CapJ = "J"
|
||||
CapK = "K"
|
||||
CapL = "L"
|
||||
CapM = "M"
|
||||
CapN = "N"
|
||||
CapO = "O"
|
||||
CapP = "P"
|
||||
CapQ = "Q"
|
||||
CapR = "R"
|
||||
CapS = "S"
|
||||
CapT = "T"
|
||||
CapU = "U"
|
||||
CapV = "V"
|
||||
CapW = "W"
|
||||
CapX = "X"
|
||||
CapY = "Y"
|
||||
CapZ = "Z"
|
||||
//
|
||||
Key0 = "0"
|
||||
Key1 = "1"
|
||||
Key2 = "2"
|
||||
|
Loading…
Reference in New Issue
Block a user