Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 62 additions & 51 deletions Assets/AltTester/Runtime/AltDriver/UnityStruct/AltKeyCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,72 @@ namespace AltTester.AltTesterUnitySDK.Driver
{
public enum AltKeyCode
{
None = 0,
NoKey = 0,
Backspace = 8,
Delete = 127,
Tab = 9,
Clear = 12,
Return = 13,
Pause = 19,
Escape = 27,
Space = 32,
Keypad0 = 256,
Keypad1 = 257,
Keypad2 = 258,
Keypad3 = 259,
Keypad4 = 260,
Keypad5 = 261,
Keypad6 = 262,
Keypad7 = 263,
Keypad8 = 264,
Keypad9 = 265,
KeypadPeriod = 266,
KeypadDivide = 267,
KeypadMultiply = 268,
KeypadMinus = 269,
KeypadPlus = 270,
KeypadEnter = 271,
KeypadEquals = 272,
UpArrow = 273,
DownArrow = 274,
RightArrow = 275,
LeftArrow = 276,
Insert = 277,
Home = 278,
End = 279,
PageUp = 280,
PageDown = 281,
F1 = 282,
F2 = 283,
F3 = 284,
F4 = 285,
F5 = 286,
F6 = 287,
F7 = 288,
F8 = 289,
F9 = 290,
F10 = 291,
F11 = 292,
F12 = 293,
F13 = 294,
F14 = 295,
F15 = 296,
Alpha0 = 48,
Alpha1 = 49,
Alpha2 = 50,
Alpha3 = 51,
Alpha4 = 52,
Alpha5 = 53,
Alpha6 = 54,
Alpha7 = 55,
Alpha8 = 56,
Alpha9 = 57,
Exclaim = 33,
DoubleQuote = 34,
Hash = 35,
Dollar = 36,
Percent = 37,
Ampersand = 38,
Quote = 39,
LeftParen = 40,
Expand All @@ -41,16 +95,6 @@ public enum AltKeyCode
Minus = 45,
Period = 46,
Slash = 47,
Alpha0 = 48,
Alpha1 = 49,
Alpha2 = 50,
Alpha3 = 51,
Alpha4 = 52,
Alpha5 = 53,
Alpha6 = 54,
Alpha7 = 55,
Alpha8 = 56,
Alpha9 = 57,
Colon = 58,
Semicolon = 59,
Less = 60,
Expand Down Expand Up @@ -94,45 +138,6 @@ public enum AltKeyCode
Pipe = 124,
RightCurlyBracket = 125,
Tilde = 126,
Delete = 127,
Keypad0 = 256,
Keypad1 = 257,
Keypad2 = 258,
Keypad3 = 259,
Keypad4 = 260,
Keypad5 = 261,
Keypad6 = 262,
Keypad7 = 263,
Keypad8 = 264,
Keypad9 = 265,
KeypadPeriod = 266,
KeypadDivide = 267,
KeypadMultiply = 268,
KeypadMinus = 269,
KeypadPlus = 270,
KeypadEnter = 271,
KeypadEquals = 272,
UpArrow = 273,
DownArrow = 274,
RightArrow = 275,
LeftArrow = 276,
Insert = 277,
Home = 278,
End = 279,
PageUp = 280,
PageDown = 281,
F1 = 282,
F2 = 283,
F3 = 284,
F4 = 285,
F5 = 286,
F6 = 287,
F7 = 288,
F8 = 289,
F9 = 290,
F10 = 291,
F11 = 292,
F12 = 293,
Numlock = 300,
CapsLock = 301,
ScrollLock = 302,
Expand All @@ -142,23 +147,29 @@ public enum AltKeyCode
LeftControl = 306,
RightAlt = 307,
LeftAlt = 308,
RightCommand = 309,
RightApple = 309,
LeftMeta = 310,
LeftCommand = 310,
LeftApple = 310,
LeftWindows = 311,
RightMeta = 309,
RightCommand = 309,
RightApple = 309,
RightWindows = 312,
AltGr = 313,
Help = 315,
Print = 316,
SysReq = 317,
Break = 318,
Menu = 319,
WheelUp = 321,
WheelDown = 322,
Mouse0 = 323,
Mouse1 = 324,
Mouse2 = 325,
Mouse3 = 326,
Mouse4 = 327,
Mouse5 = 328,
Mouse6 = 329,
JoystickButton0 = 330,
JoystickButton1 = 331,
JoystickButton2 = 332,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public void TestKeyboardPress()
var lastKeyPress = altDriver.FindObject(By.NAME, "LastKeyPressedValue");
foreach (AltKeyCode kcode in Enum.GetValues(typeof(AltKeyCode)))
{
if (kcode != AltKeyCode.NoKey && kcode < AltKeyCode.Joystick1Button0)
if (kcode != AltKeyCode.NoKey && kcode != AltKeyCode.None && kcode < AltKeyCode.Menu)
{
altDriver.PressKey(kcode, duration: 0.2f);

Expand Down
118 changes: 64 additions & 54 deletions Bindings~/java/src/main/java/com/alttester/UnityStruct/AltKeyCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,72 @@
package com.alttester.UnityStruct;

public enum AltKeyCode {
None(0),
NoKey(0),
Backspace(8),
Delete(127),
Tab(9),
Clear(12),
Return(13),
Pause(19),
Escape(27),
Space(32),
Keypad0(256),
Keypad1(257),
Keypad2(258),
Keypad3(259),
Keypad4(260),
Keypad5(261),
Keypad6(262),
Keypad7(263),
Keypad8(264),
Keypad9(265),
KeypadPeriod(266),
KeypadDivide(267),
KeypadMultiply(268),
KeypadMinus(269),
KeypadPlus(270),
KeypadEnter(271),
KeypadEquals(272),
UpArrow(273),
DownArrow(274),
RightArrow(275),
LeftArrow(276),
Insert(277),
Home(278),
End(279),
PageUp(280),
PageDown(281),
F1(282),
F2(283),
F3(284),
F4(285),
F5(286),
F6(287),
F7(288),
F8(289),
F9(290),
F10(291),
F11(292),
F12(293),
F13(294),
F14(295),
F15(296),
Alpha0(48),
Alpha1(49),
Alpha2(50),
Alpha3(51),
Alpha4(52),
Alpha5(53),
Alpha6(54),
Alpha7(55),
Alpha8(56),
Alpha9(57),
Exclaim(33),
DoubleQuote(34),
Hash(35),
Dollar(36),
Percent(37),
Ampersand(38),
Quote(39),
LeftParen(40),
Expand All @@ -40,16 +94,6 @@ public enum AltKeyCode {
Minus(45),
Period(46),
Slash(47),
Alpha0(48),
Alpha1(49),
Alpha2(50),
Alpha3(51),
Alpha4(52),
Alpha5(53),
Alpha6(54),
Alpha7(55),
Alpha8(56),
Alpha9(57),
Colon(58),
Semicolon(59),
Less(60),
Expand Down Expand Up @@ -89,48 +133,10 @@ public enum AltKeyCode {
X(120),
Y(121),
Z(122),
Delete(127),
Keypad0(256),
Keypad1(257),
Keypad2(258),
Keypad3(259),
Keypad4(260),
Keypad5(261),
Keypad6(262),
Keypad7(263),
Keypad8(264),
Keypad9(265),
KeypadPeriod(266),
KeypadDivide(267),
KeypadMultiply(268),
KeypadMinus(269),
KeypadPlus(270),
KeypadEnter(271),
KeypadEquals(272),
UpArrow(273),
DownArrow(274),
RightArrow(275),
LeftArrow(276),
Insert(277),
Home(278),
End(279),
PageUp(280),
PageDown(281),
F1(282),
F2(283),
F3(284),
F4(285),
F5(286),
F6(287),
F7(288),
F8(289),
F9(290),
F10(291),
F11(292),
F12(293),
F13(294),
F14(295),
F15(296),
LeftCurlyBracket(123),
Pipe(124),
RightCurlyBracket(125),
Tilde(126),
Numlock(300),
CapsLock(301),
ScrollLock(302),
Expand All @@ -140,18 +146,22 @@ public enum AltKeyCode {
LeftControl(306),
RightAlt(307),
LeftAlt(308),
RightCommand(309),
RightApple(309),
LeftMeta(310),
LeftCommand(310),
LeftApple(310),
LeftWindows(311),
RightMeta(309),
RightCommand(309),
RightApple(309),
RightWindows(312),
AltGr(313),
Help(315),
Print(316),
SysReq(317),
Break(318),
Menu(319),
WheelUp(321),
WheelDown(322),
Mouse0(323),
Mouse1(324),
Mouse2(325),
Expand Down
Loading