This function is called by gui_wait_for_chars() and Waits for a character from the keyboard. If wtime is -, it waits until a character is pressed. If wtime is greater than 0, it waits at most wtime milliseconds.
Returns OK if a character was found to be available within the given time (wtime), FAIL otherwise.
If wtime > 0, it uses the WinAPI function SetTimer() to call _OnTimer after wtime milliseconds.
When _OnTimer is triggered, it sets s_wait_timer to TRUE.
gui_wait_for_chars than enters a loop that is exited either when s_wait_timer was set to TRUE or when a character was pressed.
TODO: this is the function that calls MsgWaitForMultipleObjects(0, NULL, FALSE, 100, QS_ALLINPUT).
_WndProc()
_WndProc() is the Window procedure for gvim's main window.
If the message is WM_KEYDOWN or WM_SYSKEYDOWN and the virtual keycode is VK_CANCEL (= ESC?), then
trash_input_buf() is called,
ctrl_break_was_pressed is set to TRUE (TODO: however, it seems that this variable is only queried in terminal.c which doesn't seem to play a role in a gui-vim).
Ctrl_C is added to the input buffer (add_to_input_buf).
_TextAreaWndProc()
The Window procecdure for the text area inside gvim's main window.
If featureFEAT_BEVAL_GUI is enabled, it also handles WM_NOTIFY.
_OnChar()
_OnChar handles WM_CHAR messages and is (one of the?) functions that calls add_to_input_buf().
_OnSetFocus
_OnSetFocus is called when a WM_SETFOCU message is received.
_OnSetFocus calls gui_focus_change(TRUE) which in turn uses add_to_input_buf(…)[add_to_input_buf() to insert the triplet CSI, KS_EXTRA, KE_FOCUSGAINED to the input buffer.
_OnTimer
This function basically sets the static variable s_wait_timer to TRUE to indicate to the loop in gui_mch_wait_for_chars() that the duration that that function is supposed to wait for a character has expired.
get_work_area()
get_work_area determines the size of the screen, taking position on multiple monitors into account (if supported).
gui_mch_set_shellsize()
Set the size of the window to the given width and height in pixels.
gui_mch_set_fg_color() / gui_mch_set_bg_color()
Sets foreground and background color.
ex_simalt()
Implementation of the :simalt command by delibarate use of PostMessage(… WM_SYSCOMMAND …).