MCPcopy Create free account
hub / github.com/diasurgical/devilution / PressKey

Function PressKey

Source/diablo.cpp:824–1027  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

822}
823
824void PressKey(int vkey)
825{
826 if (gmenu_presskeys(vkey) || control_presskeys(vkey)) {
827 return;
828 }
829
830 if (deathflag) {
831 if (sgnTimeoutCurs != 0) {
832 return;
833 }
834 if (vkey == VK_F9) {
835 diablo_hotkey_msg(0);
836 }
837 if (vkey == VK_F10) {
838 diablo_hotkey_msg(1);
839 }
840 if (vkey == VK_F11) {
841 diablo_hotkey_msg(2);
842 }
843 if (vkey == VK_F12) {
844 diablo_hotkey_msg(3);
845 }
846 if (vkey == VK_RETURN) {
847 control_type_message();
848 }
849 if (vkey != VK_ESCAPE) {
850 return;
851 }
852 }
853 if (vkey == VK_ESCAPE) {
854 if (!PressEscKey()) {
855 track_repeat_walk(FALSE);
856 gamemenu_on();
857 }
858 return;
859 }
860
861 if (sgnTimeoutCurs != 0 || dropGoldFlag) {
862 return;
863 }
864 if (vkey == VK_PAUSE) {
865 diablo_pause_game();
866 return;
867 }
868 if (PauseMode == 2) {
869 return;
870 }
871
872 if (vkey == VK_RETURN) {
873 if (GetAsyncKeyState(VK_MENU) & 0x8000) {
874 dx_reinit();
875 } else if (stextflag) {
876 STextEnter();
877 } else if (questlog) {
878 QuestlogEnter();
879 } else {
880 control_type_message();
881 }

Callers 1

GM_GameFunction · 0.85

Calls 15

gmenu_presskeysFunction · 0.85
control_presskeysFunction · 0.85
diablo_hotkey_msgFunction · 0.85
control_type_messageFunction · 0.85
PressEscKeyFunction · 0.85
track_repeat_walkFunction · 0.85
gamemenu_onFunction · 0.85
diablo_pause_gameFunction · 0.85
GetAsyncKeyStateFunction · 0.85
dx_reinitFunction · 0.85
STextEnterFunction · 0.85
QuestlogEnterFunction · 0.85

Tested by

no test coverage detected