GrafX2 2.9.3227
The ultimate 256-color painting program
|
Functions for mouse, keyboard and joystick input. More...
#include "keycodes.h"
Macros | |
#define | SHORTCUT_COPY (KEY_c|GFX2_MOD_ALT) |
#define | SHORTCUT_PASTE (KEY_v|GFX2_MOD_ALT) |
Functions | |
int | Get_input (int sleep_time) |
This is the keyboard/mouse/joystick input polling function. More... | |
int | Is_shortcut (word key, word function) |
Returns true if the keycode has been set as a keyboard shortcut for the function. More... | |
int | Has_shortcut (word function) |
Returns true if the function has any shortcut key. More... | |
void | Adjust_mouse_sensitivity (word fullscreen) |
Adjust mouse sensitivity (and actual mouse input mode) More... | |
int | Move_cursor_with_constraints (int x, int y) |
Called each time there is a cursor move, either triggered by mouse or keyboard shortcuts. More... | |
int | Handle_mouse_btn_change (void) |
Variables | |
int | Input_sticky_control |
This holds the ID of the GUI control that the mouse is manipulating. More... | |
byte | Pan_shortcut_pressed |
State of the shortcut for panning (SPECIAL_HOLD_PAN) : pressed or not. More... | |
int | Snap_axis |
Allows locking movement to X or Y axis: 0=normal, 1=lock on next move, 2=locked horizontally, 3=locked vertically. More... | |
int | Snap_axis_origin_X |
For the :Snap_axis mode, sets the origin's point (in image coordinates) More... | |
int | Snap_axis_origin_Y |
For the :Snap_axis mode, sets the origin's point (in image coordinates) More... | |
char * | Drop_file_name |
This malloced string is set when a drag-and-drop event brings a file to Grafx2's window. More... | |
word * | Drop_file_name_unicode |
Functions for mouse, keyboard and joystick input.
Joystick input is used to emulate mouse on platforms that don't have a pointing device, ie: the GP2X.
#define SHORTCUT_COPY (KEY_c|GFX2_MOD_ALT) |
#define SHORTCUT_PASTE (KEY_v|GFX2_MOD_ALT) |
int Get_input | ( | int | sleep_time | ) |
This is the keyboard/mouse/joystick input polling function.
Returns 1 if a significant changed occurred, such as a mouse button pressed or depressed, or a new keypress was in the keyboard buffer. The latest input variables are held in Key, Key_ANSI, Key_UNICODE, Mouse_X, Mouse_Y, Mouse_K. Note that Key, Key_ANSI and Key_UNICODE are not persistent, they will be reset to 0 on subsequent calls to Get_input().
References Button_inverter, Color_cycling(), Compute_paintbrush_coordinates(), Config, Display_cursor(), Drop_file_name, Flush_update(), format, Get_Key_modifiers(), GFX2_DEBUG, GFX2_ERROR, GFX2_INFO, GFX2_Log(), GFX2_WARNING, GFX2_WINDOW_MAXIMIZED, GFX2_WINDOW_MINIMIZED, GFX2_WINDOW_STANDARD, Handle_mouse_btn_change(), Handle_special_key_press(), Input_new_mouse_K, Input_new_mouse_X, Input_new_mouse_Y, Key, Key_ANSI, KEY_MOUSEMIDDLE, KEY_MOUSEWHEELDOWN, KEY_MOUSEWHEELUP, Key_UNICODE, Mouse_Emulation(), Mouse_K, T_Config::Mouse_motion_debounce, Mouse_moved, Mouse_X, Mouse_Y, Move_cursor_with_constraints(), NULL, Pixel_height, Pixel_width, Quit_is_required, Release_control(), render_scale_x, render_scale_y, Resize_height, Resize_width, Update_rect(), user_feedback_required, T_Config::Window_pos_x, T_Config::Window_pos_y, Window_state, X11_display, and X11_window.
Referenced by Button_Anim_continuous_next(), Button_Anim_continuous_prev(), Button_Message_initial(), Button_Select_backcolor(), Button_Select_forecolor(), Curve_3_points_0_5(), Delay_with_active_mouse(), Dropdown_activate(), Get_color_behind_window(), GFX2_GetTextClipboard(), Load_ClipBoard_Image(), Main_handler(), Move_separator(), Move_window(), Readline_ex_unicode(), Redefine_control(), Tilemap_update(), Wait_click_in_palette(), Wait_click_in_shade_table(), Wait_end_of_click(), Window_clicked_button(), and Window_normal_button_onclick().
Returns true if the keycode has been set as a keyboard shortcut for the function.
References Buttons_Pool, and Config_Key.
Referenced by Button_Airbrush_menu(), Button_Anim_time(), Button_Brush_FX(), Button_Colorize_menu(), Button_Constraint_menu(), Button_Copy_page(), Button_Effects(), Button_Gradients(), Button_Grid_menu(), Button_Layer_menu(), Button_Load_or_Save(), Button_Paintbrush_menu(), Button_Palette(), Button_Quick_shade_menu(), Button_Quit_local_function(), Button_Resolution(), Button_Secondary_palette(), Button_Settings(), Button_Sieve_menu(), Button_Skins(), Button_Smooth_menu(), Button_Stats(), Button_Text(), Button_Tilemap_menu(), Button_Tiling_menu(), Button_Transform_menu(), Handle_special_key_press(), Main_handler(), Menu_shade(), Menu_tag_colors(), Save_C64_window(), Save_MOTO_window(), and Window_help().
int Has_shortcut | ( | word | function | ) |
Returns true if the function has any shortcut key.
References Buttons_Pool, Config_Key, and KEY_NONE.
void Adjust_mouse_sensitivity | ( | word | fullscreen | ) |
Adjust mouse sensitivity (and actual mouse input mode)
Referenced by Init_mode_video().
int Move_cursor_with_constraints | ( | int | x, |
int | y | ||
) |
Called each time there is a cursor move, either triggered by mouse or keyboard shortcuts.
x | new cursor X coordinate |
y | new cursor Y coordinate |
References Config, Current_operation, Hide_cursor, Input_new_mouse_X, Input_new_mouse_Y, T_Document::magnifier_mode, Main, Menu_Y, Mouse_K_unique, T_Config::Mouse_merge_movement, Mouse_moved, Mouse_X, Mouse_Y, Operation, Operation_in_magnifier, Operation_stack_size, Screen_height, Screen_width, T_Document::separator_position, Set_mouse_position(), and T_Document::X_zoom.
Referenced by Cursor_displace(), Get_input(), and Win32_WindowProc().
int Handle_mouse_btn_change | ( | void | ) |
References Hide_cursor, Input_new_mouse_K, Input_sticky_control, Mouse_K, and Mouse_moved.
Referenced by Get_input(), Handle_special_key_press(), Release_control(), and Win32_WindowProc().
|
extern |
This holds the ID of the GUI control that the mouse is manipulating.
The input system will reset it to zero when mouse button is released, but it's the engine that will record and retrieve a real control ID.
Referenced by Button_Effects(), Button_Gradients(), Button_Palette(), Handle_mouse_btn_change(), Readline_ex_unicode(), Window_clicked_button(), and Window_get_clicked_button().
|
extern |
State of the shortcut for panning (SPECIAL_HOLD_PAN) : pressed or not.
Referenced by Handle_special_key_press(), Main_handler(), Pan_view_0_0(), Pan_view_0_2(), and Release_control().
|
extern |
Allows locking movement to X or Y axis: 0=normal, 1=lock on next move, 2=locked horizontally, 3=locked vertically.
Referenced by Compute_paintbrush_coordinates(), and Release_control().
|
extern |
For the :Snap_axis mode, sets the origin's point (in image coordinates)
Referenced by Compute_paintbrush_coordinates().
|
extern |
For the :Snap_axis mode, sets the origin's point (in image coordinates)
Referenced by Compute_paintbrush_coordinates().
|
extern |
This malloced string is set when a drag-and-drop event brings a file to Grafx2's window.
Referenced by Get_input(), Main_handler(), and Win32_WindowProc().
|
extern |
Referenced by Main_handler(), and Win32_WindowProc().