#ifndef GOSU_BUTTONS_HPP #define GOSU_BUTTONS_HPP #include #ifdef GOSU_IS_MAC #define GOSU_SCANCODE(mac, windows_or_linux) mac #define GOSU_SPECIAL_SCANCODE(mac, windows, linux) mac #else #define GOSU_SCANCODE(mac, linux_or_windows) linux_or_windows #ifdef GOSU_IS_WIN #define GOSU_SPECIAL_SCANCODE(mac, windows, linux) windows #else #define GOSU_SPECIAL_SCANCODE(mac, windows, linux) linux #endif #endif namespace Gosu { //! List of button ids that can be used with Gosu::Input. //! This enumeration contains ids for keyboard keys (kb*), //! mouse buttons and mouse wheel (ms*) and gamepad buttons (gp*). enum ButtonName { kbRangeBegin, kbEscape = 41, kbF1 = 58, kbF2 = 59, kbF3 = 60, kbF4 = 61, kbF5 = 62, kbF6 = 63, kbF7 = 64, kbF8 = 65, kbF9 = 66, kbF10 = 67, kbF11 = 68, kbF12 = 69, kb0 = 30, kb1 = 31, kb2 = 32, kb3 = 33, kb4 = 34, kb5 = 35, kb6 = 36, kb7 = 37, kb8 = 38, kb9 = 39, kbTab = 43, kbReturn = 40, kbSpace = 44, kbLeftShift = 225, kbRightShift = 229, kbLeftControl = 224, kbRightControl = 228, kbLeftAlt = 226, kbRightAlt = 230, kbLeftMeta = 227, kbRightMeta = 231, kbBackspace = 42, kbLeft = 80, kbRight = 79, kbUp = 82, kbDown = 81, kbHome = 74, kbEnd = 77, kbInsert = 73, kbDelete = 76, kbPageUp = 75, kbPageDown = 78, kbEnter = 88, kbBacktick = 53, kbMinus = 45, kbEqual = 46, // TODO: Rename ->kbEquals kbBracketLeft = 47, // TODO: Rename ->kbLeftBracket kbBracketRight = 48, // TODO: Rename ->kbRightBracket kbBackslash = 49, kbSemicolon = 51, kbApostrophe = 52, kbComma = 54, kbPeriod = 55, kbSlash = 49, kbA = 4, kbB = 5, kbC = 6, kbD = 7, kbE = 8, kbF = 9, kbG = 10, kbH = 11, kbI = 12, kbJ = 13, kbK = 14, kbL = 15, kbM = 16, kbN = 17, kbO = 18, kbP = 19, kbQ = 20, kbR = 21, kbS = 22, kbT = 23, kbU = 24, kbV = 25, kbW = 26, kbX = 27, kbY = 28, kbZ = 29, kbNumpad0 = 98, kbNumpad1 = 89, kbNumpad2 = 90, kbNumpad3 = 91, kbNumpad4 = 92, kbNumpad5 = 93, kbNumpad6 = 94, kbNumpad7 = 95, kbNumpad8 = 96, kbNumpad9 = 97, kbNumpadAdd = 87, // TODO: Rename ->kbNumpadPlus kbNumpadSubtract = 86, // TODO: Rename ->kbNumpadMinus kbNumpadMultiply = 85, kbNumpadDivide = 84, kbRangeEnd = 0xff, msRangeBegin, msLeft = msRangeBegin, msRight, msMiddle, msWheelUp, msWheelDown, msOther0, msOther1, msOther2, msOther3, msOther4, msOther5, msOther6, msOther7, msRangeEnd = 0x110, gpRangeBegin, gpLeft = gpRangeBegin, gpRight, gpUp, gpDown, gpButton0, gpButton1, gpButton2, gpButton3, gpButton4, gpButton5, gpButton6, gpButton7, gpButton8, gpButton9, gpButton10, gpButton11, gpButton12, gpButton13, gpButton14, gpButton15, gp0Left, gp0Right, gp0Up, gp0Down, gp0Button0, gp0Button1, gp0Button2, gp0Button3, gp0Button4, gp0Button5, gp0Button6, gp0Button7, gp0Button8, gp0Button9, gp0Button10, gp0Button11, gp0Button12, gp0Button13, gp0Button14, gp0Button15, gp1Left, gp1Right, gp1Up, gp1Down, gp1Button0, gp1Button1, gp1Button2, gp1Button3, gp1Button4, gp1Button5, gp1Button6, gp1Button7, gp1Button8, gp1Button9, gp1Button10, gp1Button11, gp1Button12, gp1Button13, gp1Button14, gp1Button15, gp2Left, gp2Right, gp2Up, gp2Down, gp2Button0, gp2Button1, gp2Button2, gp2Button3, gp2Button4, gp2Button5, gp2Button6, gp2Button7, gp2Button8, gp2Button9, gp2Button10, gp2Button11, gp2Button12, gp2Button13, gp2Button14, gp2Button15, gp3Left, gp3Right, gp3Up, gp3Down, gp3Button0, gp3Button1, gp3Button2, gp3Button3, gp3Button4, gp3Button5, gp3Button6, gp3Button7, gp3Button8, gp3Button9, gp3Button10, gp3Button11, gp3Button12, gp3Button13, gp3Button14, gp3Button15, gpRangeEnd = gp3Button15, numButtons = gpRangeEnd + 1, numGamepads = 4, noButton = 0xffffffff, kbNum = kbRangeEnd - kbRangeBegin + 1, msNum = msRangeEnd - msRangeBegin + 1, gpNum = gpRangeEnd - gpRangeBegin + 1, gpNumPerGamepad = gpNum / (numGamepads + 1) }; } #undef GOSU_SCANCODE #undef GOSU_SPECIAL_SCANCODE #endif