toKeyCode method

KeyCode toKeyCode()

Return a keycode value.

Implementation

KeyCode toKeyCode() {
  switch (this) {
    case SDL_KeyCode.SDLK_UNKNOWN:
      return KeyCode.unknown;
    case SDL_KeyCode.SDLK_RETURN:
      return KeyCode.return_;
    case SDL_KeyCode.SDLK_ESCAPE:
      return KeyCode.escape;
    case SDL_KeyCode.SDLK_BACKSPACE:
      return KeyCode.backspace;
    case SDL_KeyCode.SDLK_TAB:
      return KeyCode.tab;
    case SDL_KeyCode.SDLK_SPACE:
      return KeyCode.space;
    case SDL_KeyCode.SDLK_EXCLAIM:
      return KeyCode.exclaim;
    case SDL_KeyCode.SDLK_QUOTEDBL:
      return KeyCode.quotedbl;
    case SDL_KeyCode.SDLK_HASH:
      return KeyCode.hash;
    case SDL_KeyCode.SDLK_PERCENT:
      return KeyCode.percent;
    case SDL_KeyCode.SDLK_DOLLAR:
      return KeyCode.dollar;
    case SDL_KeyCode.SDLK_AMPERSAND:
      return KeyCode.ampersand;
    case SDL_KeyCode.SDLK_QUOTE:
      return KeyCode.quote;
    case SDL_KeyCode.SDLK_LEFTPAREN:
      return KeyCode.leftparen;
    case SDL_KeyCode.SDLK_RIGHTPAREN:
      return KeyCode.rightparen;
    case SDL_KeyCode.SDLK_ASTERISK:
      return KeyCode.asterisk;
    case SDL_KeyCode.SDLK_PLUS:
      return KeyCode.plus;
    case SDL_KeyCode.SDLK_COMMA:
      return KeyCode.comma;
    case SDL_KeyCode.SDLK_MINUS:
      return KeyCode.minus;
    case SDL_KeyCode.SDLK_PERIOD:
      return KeyCode.period;
    case SDL_KeyCode.SDLK_SLASH:
      return KeyCode.slash;
    case SDL_KeyCode.SDLK_0:
      return KeyCode.digit0;
    case SDL_KeyCode.SDLK_1:
      return KeyCode.digit1;
    case SDL_KeyCode.SDLK_2:
      return KeyCode.digit2;
    case SDL_KeyCode.SDLK_3:
      return KeyCode.digit3;
    case SDL_KeyCode.SDLK_4:
      return KeyCode.digit4;
    case SDL_KeyCode.SDLK_5:
      return KeyCode.digit5;
    case SDL_KeyCode.SDLK_6:
      return KeyCode.digit6;
    case SDL_KeyCode.SDLK_7:
      return KeyCode.digit7;
    case SDL_KeyCode.SDLK_8:
      return KeyCode.digit8;
    case SDL_KeyCode.SDLK_9:
      return KeyCode.digit9;
    case SDL_KeyCode.SDLK_COLON:
      return KeyCode.colon;
    case SDL_KeyCode.SDLK_SEMICOLON:
      return KeyCode.semicolon;
    case SDL_KeyCode.SDLK_LESS:
      return KeyCode.less;
    case SDL_KeyCode.SDLK_EQUALS:
      return KeyCode.equals;
    case SDL_KeyCode.SDLK_GREATER:
      return KeyCode.greater;
    case SDL_KeyCode.SDLK_QUESTION:
      return KeyCode.question;
    case SDL_KeyCode.SDLK_AT:
      return KeyCode.at;
    case SDL_KeyCode.SDLK_LEFTBRACKET:
      return KeyCode.leftbracket;
    case SDL_KeyCode.SDLK_BACKSLASH:
      return KeyCode.backslash;
    case SDL_KeyCode.SDLK_RIGHTBRACKET:
      return KeyCode.rightbracket;
    case SDL_KeyCode.SDLK_CARET:
      return KeyCode.caret;
    case SDL_KeyCode.SDLK_UNDERSCORE:
      return KeyCode.underscore;
    case SDL_KeyCode.SDLK_BACKQUOTE:
      return KeyCode.backquote;
    case SDL_KeyCode.SDLK_a:
      return KeyCode.a;
    case SDL_KeyCode.SDLK_b:
      return KeyCode.b;
    case SDL_KeyCode.SDLK_c:
      return KeyCode.c;
    case SDL_KeyCode.SDLK_d:
      return KeyCode.d;
    case SDL_KeyCode.SDLK_e:
      return KeyCode.e;
    case SDL_KeyCode.SDLK_f:
      return KeyCode.f;
    case SDL_KeyCode.SDLK_g:
      return KeyCode.g;
    case SDL_KeyCode.SDLK_h:
      return KeyCode.h;
    case SDL_KeyCode.SDLK_i:
      return KeyCode.i;
    case SDL_KeyCode.SDLK_j:
      return KeyCode.j;
    case SDL_KeyCode.SDLK_k:
      return KeyCode.k;
    case SDL_KeyCode.SDLK_l:
      return KeyCode.l;
    case SDL_KeyCode.SDLK_m:
      return KeyCode.m;
    case SDL_KeyCode.SDLK_n:
      return KeyCode.n;
    case SDL_KeyCode.SDLK_o:
      return KeyCode.o;
    case SDL_KeyCode.SDLK_p:
      return KeyCode.p;
    case SDL_KeyCode.SDLK_q:
      return KeyCode.q;
    case SDL_KeyCode.SDLK_r:
      return KeyCode.r;
    case SDL_KeyCode.SDLK_s:
      return KeyCode.s;
    case SDL_KeyCode.SDLK_t:
      return KeyCode.t;
    case SDL_KeyCode.SDLK_u:
      return KeyCode.u;
    case SDL_KeyCode.SDLK_v:
      return KeyCode.v;
    case SDL_KeyCode.SDLK_w:
      return KeyCode.w;
    case SDL_KeyCode.SDLK_x:
      return KeyCode.x;
    case SDL_KeyCode.SDLK_y:
      return KeyCode.y;
    case SDL_KeyCode.SDLK_z:
      return KeyCode.z;
    case SDL_KeyCode.SDLK_CAPSLOCK:
      return KeyCode.capslock;
    case SDL_KeyCode.SDLK_F1:
      return KeyCode.f1;
    case SDL_KeyCode.SDLK_F2:
      return KeyCode.f2;
    case SDL_KeyCode.SDLK_F3:
      return KeyCode.f3;
    case SDL_KeyCode.SDLK_F4:
      return KeyCode.f4;
    case SDL_KeyCode.SDLK_F5:
      return KeyCode.f5;
    case SDL_KeyCode.SDLK_F6:
      return KeyCode.f6;
    case SDL_KeyCode.SDLK_F7:
      return KeyCode.f7;
    case SDL_KeyCode.SDLK_F8:
      return KeyCode.f8;
    case SDL_KeyCode.SDLK_F9:
      return KeyCode.f9;
    case SDL_KeyCode.SDLK_F10:
      return KeyCode.f10;
    case SDL_KeyCode.SDLK_F11:
      return KeyCode.f11;
    case SDL_KeyCode.SDLK_F12:
      return KeyCode.f12;
    case SDL_KeyCode.SDLK_PRINTSCREEN:
      return KeyCode.printscreen;
    case SDL_KeyCode.SDLK_SCROLLLOCK:
      return KeyCode.scrolllock;
    case SDL_KeyCode.SDLK_PAUSE:
      return KeyCode.pause;
    case SDL_KeyCode.SDLK_INSERT:
      return KeyCode.insert;
    case SDL_KeyCode.SDLK_HOME:
      return KeyCode.home;
    case SDL_KeyCode.SDLK_PAGEUP:
      return KeyCode.pageup;
    case SDL_KeyCode.SDLK_DELETE:
      return KeyCode.delete;
    case SDL_KeyCode.SDLK_END:
      return KeyCode.end;
    case SDL_KeyCode.SDLK_PAGEDOWN:
      return KeyCode.pagedown;
    case SDL_KeyCode.SDLK_RIGHT:
      return KeyCode.right;
    case SDL_KeyCode.SDLK_LEFT:
      return KeyCode.left;
    case SDL_KeyCode.SDLK_DOWN:
      return KeyCode.down;
    case SDL_KeyCode.SDLK_UP:
      return KeyCode.up;
    case SDL_KeyCode.SDLK_NUMLOCKCLEAR:
      return KeyCode.numlockclear;
    case SDL_KeyCode.SDLK_KP_DIVIDE:
      return KeyCode.kp_divide;
    case SDL_KeyCode.SDLK_KP_MULTIPLY:
      return KeyCode.kp_multiply;
    case SDL_KeyCode.SDLK_KP_MINUS:
      return KeyCode.kp_minus;
    case SDL_KeyCode.SDLK_KP_PLUS:
      return KeyCode.kp_plus;
    case SDL_KeyCode.SDLK_KP_ENTER:
      return KeyCode.kp_enter;
    case SDL_KeyCode.SDLK_KP_1:
      return KeyCode.kp_1;
    case SDL_KeyCode.SDLK_KP_2:
      return KeyCode.kp_2;
    case SDL_KeyCode.SDLK_KP_3:
      return KeyCode.kp_3;
    case SDL_KeyCode.SDLK_KP_4:
      return KeyCode.kp_4;
    case SDL_KeyCode.SDLK_KP_5:
      return KeyCode.kp_5;
    case SDL_KeyCode.SDLK_KP_6:
      return KeyCode.kp_6;
    case SDL_KeyCode.SDLK_KP_7:
      return KeyCode.kp_7;
    case SDL_KeyCode.SDLK_KP_8:
      return KeyCode.kp_8;
    case SDL_KeyCode.SDLK_KP_9:
      return KeyCode.kp_9;
    case SDL_KeyCode.SDLK_KP_0:
      return KeyCode.kp_0;
    case SDL_KeyCode.SDLK_KP_PERIOD:
      return KeyCode.kp_period;
    case SDL_KeyCode.SDLK_APPLICATION:
      return KeyCode.application;
    case SDL_KeyCode.SDLK_POWER:
      return KeyCode.power;
    case SDL_KeyCode.SDLK_KP_EQUALS:
      return KeyCode.kp_equals;
    case SDL_KeyCode.SDLK_F13:
      return KeyCode.f13;
    case SDL_KeyCode.SDLK_F14:
      return KeyCode.f14;
    case SDL_KeyCode.SDLK_F15:
      return KeyCode.f15;
    case SDL_KeyCode.SDLK_F16:
      return KeyCode.f16;
    case SDL_KeyCode.SDLK_F17:
      return KeyCode.f17;
    case SDL_KeyCode.SDLK_F18:
      return KeyCode.f18;
    case SDL_KeyCode.SDLK_F19:
      return KeyCode.f19;
    case SDL_KeyCode.SDLK_F20:
      return KeyCode.f20;
    case SDL_KeyCode.SDLK_F21:
      return KeyCode.f21;
    case SDL_KeyCode.SDLK_F22:
      return KeyCode.f22;
    case SDL_KeyCode.SDLK_F23:
      return KeyCode.f23;
    case SDL_KeyCode.SDLK_F24:
      return KeyCode.f24;
    case SDL_KeyCode.SDLK_EXECUTE:
      return KeyCode.execute;
    case SDL_KeyCode.SDLK_HELP:
      return KeyCode.help;
    case SDL_KeyCode.SDLK_MENU:
      return KeyCode.menu;
    case SDL_KeyCode.SDLK_SELECT:
      return KeyCode.select;
    case SDL_KeyCode.SDLK_STOP:
      return KeyCode.stop;
    case SDL_KeyCode.SDLK_AGAIN:
      return KeyCode.again;
    case SDL_KeyCode.SDLK_UNDO:
      return KeyCode.undo;
    case SDL_KeyCode.SDLK_CUT:
      return KeyCode.cut;
    case SDL_KeyCode.SDLK_COPY:
      return KeyCode.copy;
    case SDL_KeyCode.SDLK_PASTE:
      return KeyCode.paste;
    case SDL_KeyCode.SDLK_FIND:
      return KeyCode.find;
    case SDL_KeyCode.SDLK_MUTE:
      return KeyCode.mute;
    case SDL_KeyCode.SDLK_VOLUMEUP:
      return KeyCode.volumeup;
    case SDL_KeyCode.SDLK_VOLUMEDOWN:
      return KeyCode.volumedown;
    case SDL_KeyCode.SDLK_KP_COMMA:
      return KeyCode.kp_comma;
    case SDL_KeyCode.SDLK_KP_EQUALSAS400:
      return KeyCode.kp_equalsas400;
    case SDL_KeyCode.SDLK_ALTERASE:
      return KeyCode.alterase;
    case SDL_KeyCode.SDLK_SYSREQ:
      return KeyCode.sysreq;
    case SDL_KeyCode.SDLK_CANCEL:
      return KeyCode.cancel;
    case SDL_KeyCode.SDLK_CLEAR:
      return KeyCode.clear;
    case SDL_KeyCode.SDLK_PRIOR:
      return KeyCode.prior;
    case SDL_KeyCode.SDLK_RETURN2:
      return KeyCode.return2;
    case SDL_KeyCode.SDLK_SEPARATOR:
      return KeyCode.separator;
    case SDL_KeyCode.SDLK_OUT:
      return KeyCode.out;
    case SDL_KeyCode.SDLK_OPER:
      return KeyCode.oper;
    case SDL_KeyCode.SDLK_CLEARAGAIN:
      return KeyCode.clearagain;
    case SDL_KeyCode.SDLK_CRSEL:
      return KeyCode.crsel;
    case SDL_KeyCode.SDLK_EXSEL:
      return KeyCode.exsel;
    case SDL_KeyCode.SDLK_KP_00:
      return KeyCode.kp_00;
    case SDL_KeyCode.SDLK_KP_000:
      return KeyCode.kp_000;
    case SDL_KeyCode.SDLK_THOUSANDSSEPARATOR:
      return KeyCode.thousandsseparator;
    case SDL_KeyCode.SDLK_DECIMALSEPARATOR:
      return KeyCode.decimalseparator;
    case SDL_KeyCode.SDLK_CURRENCYUNIT:
      return KeyCode.currencyunit;
    case SDL_KeyCode.SDLK_CURRENCYSUBUNIT:
      return KeyCode.currencysubunit;
    case SDL_KeyCode.SDLK_KP_LEFTPAREN:
      return KeyCode.kp_leftparen;
    case SDL_KeyCode.SDLK_KP_RIGHTPAREN:
      return KeyCode.kp_rightparen;
    case SDL_KeyCode.SDLK_KP_LEFTBRACE:
      return KeyCode.kp_leftbrace;
    case SDL_KeyCode.SDLK_KP_RIGHTBRACE:
      return KeyCode.kp_rightbrace;
    case SDL_KeyCode.SDLK_KP_TAB:
      return KeyCode.kp_tab;
    case SDL_KeyCode.SDLK_KP_BACKSPACE:
      return KeyCode.kp_backspace;
    case SDL_KeyCode.SDLK_KP_A:
      return KeyCode.kp_a;
    case SDL_KeyCode.SDLK_KP_B:
      return KeyCode.kp_b;
    case SDL_KeyCode.SDLK_KP_C:
      return KeyCode.kp_c;
    case SDL_KeyCode.SDLK_KP_D:
      return KeyCode.kp_d;
    case SDL_KeyCode.SDLK_KP_E:
      return KeyCode.kp_e;
    case SDL_KeyCode.SDLK_KP_F:
      return KeyCode.kp_f;
    case SDL_KeyCode.SDLK_KP_XOR:
      return KeyCode.kp_xor;
    case SDL_KeyCode.SDLK_KP_POWER:
      return KeyCode.kp_power;
    case SDL_KeyCode.SDLK_KP_PERCENT:
      return KeyCode.kp_percent;
    case SDL_KeyCode.SDLK_KP_LESS:
      return KeyCode.kp_less;
    case SDL_KeyCode.SDLK_KP_GREATER:
      return KeyCode.kp_greater;
    case SDL_KeyCode.SDLK_KP_AMPERSAND:
      return KeyCode.kp_ampersand;
    case SDL_KeyCode.SDLK_KP_DBLAMPERSAND:
      return KeyCode.kp_dblampersand;
    case SDL_KeyCode.SDLK_KP_VERTICALBAR:
      return KeyCode.kp_verticalbar;
    case SDL_KeyCode.SDLK_KP_DBLVERTICALBAR:
      return KeyCode.kp_dblverticalbar;
    case SDL_KeyCode.SDLK_KP_COLON:
      return KeyCode.kp_colon;
    case SDL_KeyCode.SDLK_KP_HASH:
      return KeyCode.kp_hash;
    case SDL_KeyCode.SDLK_KP_SPACE:
      return KeyCode.kp_space;
    case SDL_KeyCode.SDLK_KP_AT:
      return KeyCode.kp_at;
    case SDL_KeyCode.SDLK_KP_EXCLAM:
      return KeyCode.kp_exclam;
    case SDL_KeyCode.SDLK_KP_MEMSTORE:
      return KeyCode.kp_memstore;
    case SDL_KeyCode.SDLK_KP_MEMRECALL:
      return KeyCode.kp_memrecall;
    case SDL_KeyCode.SDLK_KP_MEMCLEAR:
      return KeyCode.kp_memclear;
    case SDL_KeyCode.SDLK_KP_MEMADD:
      return KeyCode.kp_memadd;
    case SDL_KeyCode.SDLK_KP_MEMSUBTRACT:
      return KeyCode.kp_memsubtract;
    case SDL_KeyCode.SDLK_KP_MEMMULTIPLY:
      return KeyCode.kp_memmultiply;
    case SDL_KeyCode.SDLK_KP_MEMDIVIDE:
      return KeyCode.kp_memdivide;
    case SDL_KeyCode.SDLK_KP_PLUSMINUS:
      return KeyCode.kp_plusminus;
    case SDL_KeyCode.SDLK_KP_CLEAR:
      return KeyCode.kp_clear;
    case SDL_KeyCode.SDLK_KP_CLEARENTRY:
      return KeyCode.kp_clearentry;
    case SDL_KeyCode.SDLK_KP_BINARY:
      return KeyCode.kp_binary;
    case SDL_KeyCode.SDLK_KP_OCTAL:
      return KeyCode.kp_octal;
    case SDL_KeyCode.SDLK_KP_DECIMAL:
      return KeyCode.kp_decimal;
    case SDL_KeyCode.SDLK_KP_HEXADECIMAL:
      return KeyCode.kp_hexadecimal;
    case SDL_KeyCode.SDLK_LCTRL:
      return KeyCode.lctrl;
    case SDL_KeyCode.SDLK_LSHIFT:
      return KeyCode.lshift;
    case SDL_KeyCode.SDLK_LALT:
      return KeyCode.lalt;
    case SDL_KeyCode.SDLK_LGUI:
      return KeyCode.lgui;
    case SDL_KeyCode.SDLK_RCTRL:
      return KeyCode.rctrl;
    case SDL_KeyCode.SDLK_RSHIFT:
      return KeyCode.rshift;
    case SDL_KeyCode.SDLK_RALT:
      return KeyCode.ralt;
    case SDL_KeyCode.SDLK_RGUI:
      return KeyCode.rgui;
    case SDL_KeyCode.SDLK_MODE:
      return KeyCode.mode;
    case SDL_KeyCode.SDLK_AUDIONEXT:
      return KeyCode.audionext;
    case SDL_KeyCode.SDLK_AUDIOPREV:
      return KeyCode.audioprev;
    case SDL_KeyCode.SDLK_AUDIOSTOP:
      return KeyCode.audiostop;
    case SDL_KeyCode.SDLK_AUDIOPLAY:
      return KeyCode.audioplay;
    case SDL_KeyCode.SDLK_AUDIOMUTE:
      return KeyCode.audiomute;
    case SDL_KeyCode.SDLK_MEDIASELECT:
      return KeyCode.mediaselect;
    case SDL_KeyCode.SDLK_WWW:
      return KeyCode.www;
    case SDL_KeyCode.SDLK_MAIL:
      return KeyCode.mail;
    case SDL_KeyCode.SDLK_CALCULATOR:
      return KeyCode.calculator;
    case SDL_KeyCode.SDLK_COMPUTER:
      return KeyCode.computer;
    case SDL_KeyCode.SDLK_AC_SEARCH:
      return KeyCode.ac_search;
    case SDL_KeyCode.SDLK_AC_HOME:
      return KeyCode.ac_home;
    case SDL_KeyCode.SDLK_AC_BACK:
      return KeyCode.ac_back;
    case SDL_KeyCode.SDLK_AC_FORWARD:
      return KeyCode.ac_forward;
    case SDL_KeyCode.SDLK_AC_STOP:
      return KeyCode.ac_stop;
    case SDL_KeyCode.SDLK_AC_REFRESH:
      return KeyCode.ac_refresh;
    case SDL_KeyCode.SDLK_AC_BOOKMARKS:
      return KeyCode.ac_bookmarks;
    case SDL_KeyCode.SDLK_BRIGHTNESSDOWN:
      return KeyCode.brightnessdown;
    case SDL_KeyCode.SDLK_BRIGHTNESSUP:
      return KeyCode.brightnessup;
    case SDL_KeyCode.SDLK_DISPLAYSWITCH:
      return KeyCode.displayswitch;
    case SDL_KeyCode.SDLK_KBDILLUMTOGGLE:
      return KeyCode.kbdillumtoggle;
    case SDL_KeyCode.SDLK_KBDILLUMDOWN:
      return KeyCode.kbdillumdown;
    case SDL_KeyCode.SDLK_KBDILLUMUP:
      return KeyCode.kbdillumup;
    case SDL_KeyCode.SDLK_EJECT:
      return KeyCode.eject;
    case SDL_KeyCode.SDLK_SLEEP:
      return KeyCode.sleep;
    case SDL_KeyCode.SDLK_APP1:
      return KeyCode.app1;
    case SDL_KeyCode.SDLK_APP2:
      return KeyCode.app2;
    case SDL_KeyCode.SDLK_AUDIOREWIND:
      return KeyCode.audiorewind;
    case SDL_KeyCode.SDLK_AUDIOFASTFORWARD:
      return KeyCode.audiofastforward;
    default:
      throw SdlError(this, 'Unknown keycode.');
  }
}