Does anyone know how to press the up arrow and print screen keys with Arduino keyboard emulation?
Try...
Keyboard.press(38); //Press Up Arrow
Keyboard.press(42); //Press Print
delay(100); //wait
Keyboard.releaseAll(); //release
Thank you! Do you know what number represents the option and command keys?
Sounds like a MAC
I think Command is 55 and option is 58
Thanks! so would down arrow be 37, left 36 and right 35?
Try these and see if they work. MAC codes are different from PC codes.
NAME CODE VALUE
0 29
1 18
2 19
3 20
4 21
5 23
6 22
7 26
8 28
9 25
A 0
B 11
C 8
D 2
E 14
F 3
G 5
H 4
I 34
J 38
K 40
L 37
M 46
N 45
O 31
P 35
Q 12
R 15
S 1
T 17
U 32
V 9
W 13
X 7
Y 16
Z 6
SectionSign ? 10
Grave ` 50
Minus - 27
Equal = 24
LeftBracket [ 33
RightBracket ] 30
Semicolon ; 41
Quote ' 39
Comma "," 43
Period . 47
Slash / 44
Backslash \ 42
Keypad0 0 82
Keypad1 1 83
Keypad2 2 84
Keypad3 3 85
Keypad4 4 86
Keypad5 5 87
Keypad6 6 88
Keypad7 7 89
Keypad8 8 91
Keypad9 9 92
KeypadDecimal . 65
KeypadMultiply * 67
KeypadPlus + 69
KeypadDivide / 75
KeypadMinus - 78
KeypadEquals = 81
KeypadClear ? 71
KeypadEnter ? 76
Space ? 49
Return ? 36
Tab ? 48
Delete ? 51
ForwardDelete ? 117
Linefeed ? 52
Escape ? 53
Command ? 55
Shift ? 56
CapsLock ? 57
Option ? 58
Control ? 59
RightShift ? 60
RightOption ? 61
RightControl ? 62
Function fn 63
F1 122
F2 120
F3 99
F4 118
F5 96
F6 97
F7 98
F8 100
F9 101
F10 109
F11 103
F12 111
F13 105
BrightnessDown F14 107
BrightnessUp F15 113
F16 106
F17 64
F18 79
F19 80
F20 90
VolumeUp ? 72
VolumeDown ? 73
Mute ? 74
Help/Insert ? 114
Home ? 115
End ? 119
PageUp ? 116
PageDown ? 121
LeftArrow ? 123
RightArrow ? 124
DownArrow ? 125
UpArrow ? 126
Do the above work with windows or mac? (I'm using windows)
Those are Mac codes but Windows does not have a command nor option key?
Microsoft Virtual-Key Codes are here...
it's saying that the print screen code is 2C, is that correct?
There are some helpful macros listed here that will make your code a bit more readable:
e.g.:
Keyboard.press(KEY_UP_ARROW);
but printscreen isn't on the list.