hschumann2/TempleOS-Source-Code
0847
1 2U0 MsgLoop()3{4 I64 arg1,arg2,msg_code;5 "Use msg_code defines in your programs instead of hardcoded nums.\n"6 "<ESC> to Exit\n";7 8 //We don't want the mouse bttns to reposition the cursor,9 //so we inhibit the window mgr from processing them.10 11 Fs->win_inhibit=WIF_SELF_MS_L|WIF_SELF_MS_R;12 13 do {14 msg_code=GetMsg(&arg1,&arg2,~(1<<MSG_NULL));15 "CMD:%02X ARG1:%08X ARG2:%016X\n",msg_code,arg1,arg2;16 } while (msg_code!=MSG_KEY_DOWN || arg1!=CH_ESC && arg1!=CH_SHIFT_ESC);17 GetMsg(,,1<<MSG_KEY_UP);18 19 Fs->win_inhibit=WIG_USER_TASK_DFT;20}21 22MsgLoop;23 24// Press <CTRL-SHIFT-L> and "Insert ASCII/ScanCode".25 