static void window_text_input_mouseup(){ short widgetIndex; rct_window *w; rct_window *calling_w; window_widget_get_registers(w, widgetIndex); calling_w = window_find_by_number(calling_class, calling_number); switch (widgetIndex){ case WIDX_CANCEL: case WIDX_CLOSE: platform_stop_text_input(); // Pass back the text that has been entered. // ecx when zero means text input failed if (calling_w != NULL) window_event_textinput_call(calling_w, calling_widget, NULL); window_close(w); break; case WIDX_OKAY: platform_stop_text_input(); // Pass back the text that has been entered. // ecx when none zero means text input success if (calling_w != NULL) window_event_textinput_call(calling_w, calling_widget, text_input); window_close(w); } }
void window_text_input_key(rct_window* w, sint32 key) { char new_char = platform_scancode_to_rct_keycode(0xFF&key); // If the return button is pressed stop text input if (new_char == '\r'){ platform_stop_text_input(); window_close(w); rct_window* calling_w = window_find_by_number(calling_class, calling_number); // Pass back the text that has been entered. // ecx when none zero means text input success if (calling_w) window_event_textinput_call(calling_w, calling_widget, text_input); } window_invalidate(w); }
static void window_text_input_close(rct_window *w) { // Make sure that we take it out of the text input // mode otherwise problems may occur. platform_stop_text_input(); }
void console_close() { gConsoleOpen = false; console_invalidate(); platform_stop_text_input(); }
void chat_close() { gChatOpen = false; platform_stop_text_input(); }