| 2674 | } |
| 2675 | |
| 2676 | void CGameScreen::OnTextInput(const TextEvent &ev) |
| 2677 | { |
| 2678 | if (g_EntryPointer == nullptr) |
| 2679 | { |
| 2680 | return; //Ignore no print keys |
| 2681 | } |
| 2682 | |
| 2683 | const auto ch = EvChar(ev); |
| 2684 | if (g_EntryPointer != &g_GameConsole && ch != 0x11 && ch != 0x17) |
| 2685 | { |
| 2686 | if (g_GumpManager.OnTextInput(ev, false)) |
| 2687 | { |
| 2688 | return; |
| 2689 | } |
| 2690 | } |
| 2691 | |
| 2692 | const auto mod = SDL_GetModState(); |
| 2693 | const bool altGR = (mod & KMOD_RALT) != 0; |
| 2694 | const bool altPressed = (mod & KMOD_ALT) != 0; |
| 2695 | const bool ctrlPressed = (mod & KMOD_CTRL) != 0; |
| 2696 | |
| 2697 | if ((altGR || (!altPressed && !ctrlPressed)) && |
| 2698 | (int)g_EntryPointer->Length() < std::max(g_EntryPointer->MaxLength, 60)) |
| 2699 | { |
| 2700 | g_EntryPointer->Insert(ch); |
| 2701 | } |
| 2702 | } |
| 2703 | |
| 2704 | void CGameScreen::OnKeyDown(const KeyEvent &ev) |
| 2705 | { |
nothing calls this directly
no test coverage detected