From ebfab162993851ab2f127f4dc267cfeb7e1fb2c0 Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Mon, 1 Nov 2021 23:15:26 -0500 Subject: [PATCH] renamed key constants --- misc/onyx/heartbreak_input.onyx | 118 ++++++++++++++++---------------- tests/simp.onyx | 2 +- 2 files changed, 60 insertions(+), 60 deletions(-) diff --git a/misc/onyx/heartbreak_input.onyx b/misc/onyx/heartbreak_input.onyx index 3c7722e..b5c8711 100644 --- a/misc/onyx/heartbreak_input.onyx +++ b/misc/onyx/heartbreak_input.onyx @@ -1,13 +1,13 @@ package heartbreak.input KeyConstant :: enum { - UNKNOWN :: 0; - SPACE :: 32; - APOSTROPHE :: 39; /* ' */ - COMMA :: 44; /* , */ - MINUS :: 45; /* - */ - PERIOD :: 46; /* . */ - SLASH :: 47; /* / */ + Unknown :: 0; + Space :: 32; + Apostrophe :: 39; /* ' */ + Comma :: 44; /* , */ + Minus :: 45; /* - */ + Period :: 46; /* . */ + Slash :: 47; /* / */ _0 :: 48; _1 :: 49; @@ -19,8 +19,8 @@ KeyConstant :: enum { _7 :: 55; _8 :: 56; _9 :: 57; - SEMICOLON :: 59; /* ; */ - EQUAL :: 61; /* = */ + Semicolon :: 59; /* ; */ + Equal :: 61; /* = */ A :: 65; B :: 66; @@ -48,31 +48,31 @@ KeyConstant :: enum { X :: 88; Y :: 89; Z :: 90; - LEFT_BRACKET :: 91; /* [ */ - BACKSLASH :: 92; /* \ */ - RIGHT_BRACKET :: 93; /* ] */ - GRAVE_ACCENT :: 96; /* ` */ - WORLD_1 :: 161; /* non-US #1 */ - WORLD_2 :: 162; /* non-US #2 */ - ESCAPE :: 256; - ENTER :: 257; - TAB :: 258; - BACKSPACE :: 259; - INSERT :: 260; - DELETE :: 261; - RIGHT :: 262; - LEFT :: 263; - DOWN :: 264; - UP :: 265; - PAGE_UP :: 266; - PAGE_DOWN :: 267; - HOME :: 268; - END :: 269; - CAPS_LOCK :: 280; - SCROLL_LOCK :: 281; - NUM_LOCK :: 282; - PRINT_SCREEN :: 283; - PAUSE :: 284; + Left_Bracket :: 91; /* [ */ + Backslash :: 92; /* \ */ + Right_Bracket :: 93; /* ] */ + Grave_Accent :: 96; /* ` */ + World_1 :: 161; /* non-US #1 */ + World_2 :: 162; /* non-US #2 */ + Escape :: 256; + Enter :: 257; + Tab :: 258; + Backspace :: 259; + Insert :: 260; + Delete :: 261; + Right :: 262; + Left :: 263; + Down :: 264; + Up :: 265; + Page_Up :: 266; + Page_Down :: 267; + Home :: 268; + End :: 269; + Caps_Lock :: 280; + Scroll_Lock :: 281; + Num_Lock :: 282; + Print_Screen :: 283; + Pause :: 284; F1 :: 290; F2 :: 291; F3 :: 292; @@ -108,34 +108,34 @@ KeyConstant :: enum { KP_7 :: 327; KP_8 :: 328; KP_9 :: 329; - KP_DECIMAL :: 330; - KP_DIVIDE :: 331; - KP_MULTIPLY :: 332; - KP_SUBTRACT :: 333; - KP_ADD :: 334; - KP_ENTER :: 335; - KP_EQUAL :: 336; - LEFT_SHIFT :: 340; - LEFT_CONTROL :: 341; - LEFT_ALT :: 342; - LEFT_SUPER :: 343; - RIGHT_SHIFT :: 344; - RIGHT_CONTROL :: 345; - RIGHT_ALT :: 346; - RIGHT_SUPER :: 347; - MENU :: 348; - LAST :: 348; + KP_Decimal :: 330; + KP_Divide :: 331; + KP_Multiply :: 332; + KP_Subtract :: 333; + KP_Add :: 334; + KP_Enter :: 335; + KP_Equal :: 336; + Left_Shift :: 340; + Left_Control :: 341; + Left_Alt :: 342; + Left_Super :: 343; + Right_Shift :: 344; + Right_Control :: 345; + Right_Alt :: 346; + Right_Super :: 347; + Menu :: 348; + Last :: 348; } ButtonConstant :: enum { - BUTTON_1 :: 0; - BUTTON_2 :: 1; - BUTTON_3 :: 2; - BUTTON_4 :: 3; - BUTTON_5 :: 4; - BUTTON_6 :: 5; - BUTTON_7 :: 6; - BUTTON_8 :: 7; + Button_1 :: 0; + Button_2 :: 1; + Button_3 :: 2; + Button_4 :: 3; + Button_5 :: 4; + Button_6 :: 5; + Button_7 :: 6; + Button_8 :: 7; Left :: 0; Right :: 1; diff --git a/tests/simp.onyx b/tests/simp.onyx index 1912180..602717b 100644 --- a/tests/simp.onyx +++ b/tests/simp.onyx @@ -16,7 +16,7 @@ t: f32 = 0; update :: (dt: f32) { t += 0.016; - if hb.input.keyIsDown(.ESCAPE) { + if hb.input.keyIsDown(.Escape) { hb.window.setShouldClose(true); } -- 2.25.1