MCPcopy Create free account
hub / github.com/SFML/SFML / androidKeyToSF

Method androidKeyToSF

src/SFML/Window/Android/WindowImplAndroid.cpp:603–723  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

601
602////////////////////////////////////////////////////////////
603std::variant<Keyboard::Key, Joystick::Button> WindowImplAndroid::androidKeyToSF(std::int32_t key)
604{
605 // clang-format off
606 switch (key)
607 {
608 case AKEYCODE_UNKNOWN:
609 case AKEYCODE_SOFT_LEFT:
610 case AKEYCODE_SOFT_RIGHT:
611 case AKEYCODE_HOME: return Keyboard::Key::Unknown;
612 case AKEYCODE_BACK: return Keyboard::Key::Escape;
613 case AKEYCODE_CALL:
614 case AKEYCODE_ENDCALL: return Keyboard::Key::Unknown;
615 case AKEYCODE_0: return Keyboard::Key::Num0;
616 case AKEYCODE_1: return Keyboard::Key::Num1;
617 case AKEYCODE_2: return Keyboard::Key::Num2;
618 case AKEYCODE_3: return Keyboard::Key::Num3;
619 case AKEYCODE_4: return Keyboard::Key::Num4;
620 case AKEYCODE_5: return Keyboard::Key::Num5;
621 case AKEYCODE_6: return Keyboard::Key::Num6;
622 case AKEYCODE_7: return Keyboard::Key::Num7;
623 case AKEYCODE_8: return Keyboard::Key::Num8;
624 case AKEYCODE_9: return Keyboard::Key::Num9;
625 case AKEYCODE_STAR:
626 case AKEYCODE_POUND: return Keyboard::Key::Unknown;
627 case AKEYCODE_DPAD_UP: return Joystick::Button::DpadUp;
628 case AKEYCODE_DPAD_DOWN: return Joystick::Button::DpadDown;
629 case AKEYCODE_DPAD_LEFT: return Joystick::Button::DpadLeft;
630 case AKEYCODE_DPAD_RIGHT: return Joystick::Button::DpadRight;
631 case AKEYCODE_DPAD_CENTER: return Joystick::Button::DpadCenter;
632 case AKEYCODE_VOLUME_UP:
633 case AKEYCODE_VOLUME_DOWN:
634 case AKEYCODE_POWER:
635 case AKEYCODE_CAMERA:
636 case AKEYCODE_CLEAR: return Keyboard::Key::Unknown;
637 case AKEYCODE_A: return Keyboard::Key::A;
638 case AKEYCODE_B: return Keyboard::Key::B;
639 case AKEYCODE_C: return Keyboard::Key::C;
640 case AKEYCODE_D: return Keyboard::Key::D;
641 case AKEYCODE_E: return Keyboard::Key::E;
642 case AKEYCODE_F: return Keyboard::Key::F;
643 case AKEYCODE_G: return Keyboard::Key::G;
644 case AKEYCODE_H: return Keyboard::Key::H;
645 case AKEYCODE_I: return Keyboard::Key::I;
646 case AKEYCODE_J: return Keyboard::Key::J;
647 case AKEYCODE_K: return Keyboard::Key::K;
648 case AKEYCODE_L: return Keyboard::Key::L;
649 case AKEYCODE_M: return Keyboard::Key::M;
650 case AKEYCODE_N: return Keyboard::Key::N;
651 case AKEYCODE_O: return Keyboard::Key::O;
652 case AKEYCODE_P: return Keyboard::Key::P;
653 case AKEYCODE_Q: return Keyboard::Key::Q;
654 case AKEYCODE_R: return Keyboard::Key::R;
655 case AKEYCODE_S: return Keyboard::Key::S;
656 case AKEYCODE_T: return Keyboard::Key::T;
657 case AKEYCODE_U: return Keyboard::Key::U;
658 case AKEYCODE_V: return Keyboard::Key::V;
659 case AKEYCODE_W: return Keyboard::Key::W;
660 case AKEYCODE_X: return Keyboard::Key::X;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected