/* Set keyboard focus window or NULL, i.e., receiver of keyboard events. 
This function changes the keyboard focus window. The current keyboard focus window is sent a LOSEFOCUS event, and the new focus window is sent a GETFOCUS event. The keyboard focus window will receive all keyboard events. Set the focus window to NULL to remove the focus. */
void win_set_keyboard_focus(struct win_window *win)
/* Set keyboard focus window or NULL, i.e., receiver of keyboard events. 
This function changes the keyboard focus window. The current keyboard focus window is sent a LOSEFOCUS event, and the new focus window is sent a GETFOCUS event. The keyboard focus window will receive all keyboard events. Set the focus window to NULL to remove the focus. */
void win_set_keyboard_focus(struct win_window *win)
{
	if (win_keyboard_focus != NULL) {
		win_handle_event(win_keyboard_focus, WIN_EVENT_LOSEFOCUS, NULL);
	}
	win_keyboard_focus = win;
	win_handle_event(win, WIN_EVENT_GETFOCUS, NULL);
}