# input.c File Reference

`#include <SDL.h>`
`#include "global.h"`
`#include "clavier.h"`
`#include "sdlscreen.h"`
`#include "windows.h"`
`#include "erreurs.h"`
`#include "divers.h"`
`#include "input.h"`

## Functions
void | Handle_Window_Resize (SDL_ResizeEvent event)
void | Handle_Window_Exit (SDL_QuitEvent event)
int | Est_Raccourci (word Touche, word Fonction)
int | Move_cursor_with_constraints ()
void | Gere_Evenement_SDL (SDL_Event *event)
void | Handle_Window_Exit (__attribute__((unused)) SDL_QuitEvent event)
int | Handle_Mouse_Move (SDL_MouseMotionEvent event)
int | Handle_Mouse_Click (SDL_MouseButtonEvent event)
int | Handle_Mouse_Release (SDL_MouseButtonEvent event)
int | Handle_Key_Press (SDL_KeyboardEvent event)
int | Relache_controle (int CodeTouche, int Modifieur)
int | Handle_Key_Release (SDL_KeyboardEvent event)
int | Handle_Joystick_Press (SDL_JoyButtonEvent event)
int | Handle_Joystick_Release (SDL_JoyButtonEvent event)
void | Handle_Joystick_Movement (SDL_JoyAxisEvent event)
int | Cursor_displace (short Delta_X, short Delta_Y)
int | Get_input (void)
## Variables
byte | Directional_up
byte | Directional_up_right
byte | Directional_right
byte | Directional_down_right
byte | Directional_down
byte | Directional_down_left
byte | Directional_left
byte | Directional_up_left
long | Directional_delay
long | Directional_last_move
long | Directional_step
short | Mouse_count
short | Button_shift = -1
short | Button_control = -1
short | Button_alt = -1
short | Button_clic_gauche = 0
short | Button_clic_droit = 0

## Function Documentation

void Handle_Window_Resize | ( | SDL_ResizeEvent | event | ) |

References Resize_Hauteur, and Resize_Largeur.

Referenced by Gere_Evenement_SDL(), and Get_input().

void Handle_Window_Exit | ( | SDL_QuitEvent | event | ) |

Referenced by Gere_Evenement_SDL(), and Get_input().

int Est_Raccourci | ( | word | Touche,
|  | word | Fonction |
| ) |  |  |

References Bouton, Config_Touche, Raccourci_droite, and Raccourci_gauche.

Referenced by Bouton_Brush_FX(), Bouton_Colorize_Menu(), Bouton_Copy_page(), Bouton_Degrades(), Bouton_Effets(), Bouton_Load_ou_Save(), Bouton_Menu_Grille(), Bouton_Menu_Loupe(), Bouton_Menu_pinceaux(), Bouton_Palette(), Bouton_Palette_secondaire(), Bouton_Quick_shade_Menu(), Bouton_Quitter_Routine_locale(), Bouton_Resol(), Bouton_Settings(), Bouton_Smooth_Menu(), Bouton_Spray_Menu(), Bouton_Texte(), Bouton_Tiling_Menu(), Bouton_Trame_Menu(), Gestion_principale(), Handle_Key_Press(), Menu_Shade(), and Menu_Tag_couleurs().

int Move_cursor_with_constraints | ( |  | ) |

References Afficher_curseur(), Calculer_coordonnees_pinceau(), Config, Effacer_curseur, Forcer_affichage_curseur, INPUT_Nouveau_Mouse_K, INPUT_Nouveau_Mouse_X, INPUT_Nouveau_Mouse_Y, Loupe_Mode, Menu_Ordonnee, Mouse_count, Mouse_K, S_Config::Mouse_Merge_movement, Mouse_X, Mouse_Y, Operation_dans_loupe, Operation_Taille_pile, Pixel_height, Pixel_width, Principal_Split, and Principal_X_Zoom.

Referenced by Cursor_displace(), Handle_Joystick_Press(), Handle_Joystick_Release(), Handle_Key_Press(), Handle_Mouse_Click(), Handle_Mouse_Move(), Handle_Mouse_Release(), and Relache_controle().

void Gere_Evenement_SDL | ( | SDL_Event * | event | ) |

References Handle_Window_Exit(), and Handle_Window_Resize().

void Handle_Window_Exit | ( | __attribute__((unused)) SDL_QuitEvent | event | ) |

References Quit_demande.

int Handle_Mouse_Move | ( | SDL_MouseMotionEvent | event | ) |

References INPUT_Nouveau_Mouse_X, INPUT_Nouveau_Mouse_Y, Move_cursor_with_constraints(), Pixel_height, and Pixel_width.

Referenced by Get_input().

int Handle_Mouse_Click | ( | SDL_MouseButtonEvent | event | ) |

References INPUT_Nouveau_Mouse_K, Modificateurs_Touche(), Move_cursor_with_constraints(), Touche, TOUCHE_MOUSEMIDDLE, TOUCHE_MOUSEWHEELDOWN, and TOUCHE_MOUSEWHEELUP.

Referenced by Get_input().

int Handle_Mouse_Release | ( | SDL_MouseButtonEvent | event | ) |

References INPUT_Nouveau_Mouse_K, and Move_cursor_with_constraints().

Referenced by Get_input().

int Handle_Key_Press | ( | SDL_KeyboardEvent | event | ) |

References Autoriser_changement_de_couleur_pendant_operation, Conversion_ANSI(), Conversion_Touche(), Directional_down, Directional_left, Directional_right, Directional_up, Est_Raccourci(), INPUT_Nouveau_Mouse_K, Move_cursor_with_constraints(), Operation_Taille_pile, SPECIAL_CLICK_LEFT, SPECIAL_CLICK_RIGHT, SPECIAL_GROSSIR_PINCEAU, SPECIAL_MOUSE_DOWN, SPECIAL_MOUSE_LEFT, SPECIAL_MOUSE_RIGHT, SPECIAL_MOUSE_UP, SPECIAL_NEXT_BACKCOLOR, SPECIAL_NEXT_FORECOLOR, SPECIAL_NEXT_USER_BACKCOLOR, SPECIAL_NEXT_USER_FORECOLOR, SPECIAL_PREVIOUS_BACKCOLOR, SPECIAL_PREVIOUS_FORECOLOR, SPECIAL_PREVIOUS_USER_BACKCOLOR, SPECIAL_PREVIOUS_USER_FORECOLOR, SPECIAL_RETRECIR_PINCEAU, Touche, and Touche_ANSI.

Referenced by Get_input().

int Relache_controle | ( | int | CodeTouche,
|  | int | Modifieur |
| ) |  |  |

References Config_Touche, Directional_down, Directional_left, Directional_right, Directional_up, INPUT_Nouveau_Mouse_K, Move_cursor_with_constraints(), SPECIAL_CLICK_LEFT, SPECIAL_CLICK_RIGHT, SPECIAL_MOUSE_DOWN, SPECIAL_MOUSE_LEFT, SPECIAL_MOUSE_RIGHT, and SPECIAL_MOUSE_UP.

Referenced by Handle_Joystick_Release(), and Handle_Key_Release().

int Handle_Key_Release | ( | SDL_KeyboardEvent | event | ) |

References Conversion_Touche(), MOD_ALT, MOD_CTRL, MOD_SHIFT, and Relache_controle().

Referenced by Get_input().

int Handle_Joystick_Press | ( | SDL_JoyButtonEvent | event | ) |

References Button_alt, Button_clic_droit, Button_clic_gauche, Button_control, Button_shift, Directional_down, Directional_down_left, Directional_down_right, Directional_left, Directional_right, Directional_up, Directional_up_left, Directional_up_right, INPUT_Nouveau_Mouse_K, Modificateurs_Touche(), Move_cursor_with_constraints(), Touche, and TOUCHE_BUTTON.

Referenced by Get_input().

int Handle_Joystick_Release | ( | SDL_JoyButtonEvent | event | ) |

References Button_alt, Button_control, Button_shift, Directional_down, Directional_down_left, Directional_down_right, Directional_left, Directional_right, Directional_up, Directional_up_left, Directional_up_right, INPUT_Nouveau_Mouse_K, MOD_ALT, MOD_CTRL, MOD_SHIFT, Move_cursor_with_constraints(), and Relache_controle().

Referenced by Get_input().

void Handle_Joystick_Movement | ( | SDL_JoyAxisEvent | event | ) |

References Directional_down, Directional_left, Directional_right, and Directional_up.

Referenced by Get_input().

int Cursor_displace | ( | short | Delta_X,
|  | short | Delta_Y |
| ) |  |  |

References Hauteur_ecran, INPUT_Nouveau_Mouse_X, INPUT_Nouveau_Mouse_Y, Largeur_ecran, Loupe_Facteur, Loupe_Mode, Max(), Min(), Move_cursor_with_constraints(), and Principal_Split.

Referenced by Get_input().

int Get_input | ( | void |  | ) |

References Cursor_displace(), Directional_delay, Directional_down, Directional_down_left, Directional_down_right, Directional_last_move, Directional_left, Directional_right, Directional_step, Directional_up, Directional_up_left, Directional_up_right, Flush_update(), Handle_Joystick_Movement(), Handle_Joystick_Press(), Handle_Joystick_Release(), Handle_Key_Press(), Handle_Key_Release(), Handle_Mouse_Click(), Handle_Mouse_Move(), Handle_Mouse_Release(), Handle_Window_Exit(), Handle_Window_Resize(), Mouse_count, Touche, and Touche_ANSI.

Referenced by Attendre_click_dans_palette(), Attendre_click_dans_shade(), Attendre_fin_de_click(), Bouton_Message_initial(), Deplacer_fenetre(), Deplacer_Split(), Fenetre_Bouton_clicke(), Fenetre_bouton_normal_click(), Fenetre_Dropdown_click(), Gestion_principale(), Readline_ex(), Recuperer_couleur_derriere_fenetre(), Redefinir_controle(), and Tempo_jauge().

## Variable Documentation

byte Directional_up

Referenced by Get_input(), Handle_Joystick_Movement(), Handle_Joystick_Press(), Handle_Joystick_Release(), Handle_Key_Press(), and Relache_controle().

byte Directional_up_right

Referenced by Get_input(), Handle_Joystick_Press(), and Handle_Joystick_Release().

byte Directional_right

Referenced by Get_input(), Handle_Joystick_Movement(), Handle_Joystick_Press(), Handle_Joystick_Release(), Handle_Key_Press(), and Relache_controle().

byte Directional_down_right

Referenced by Get_input(), Handle_Joystick_Press(), and Handle_Joystick_Release().

byte Directional_down

Referenced by Get_input(), Handle_Joystick_Movement(), Handle_Joystick_Press(), Handle_Joystick_Release(), Handle_Key_Press(), and Relache_controle().

byte Directional_down_left

Referenced by Get_input(), Handle_Joystick_Press(), and Handle_Joystick_Release().

byte Directional_left

Referenced by Get_input(), Handle_Joystick_Movement(), Handle_Joystick_Press(), Handle_Joystick_Release(), Handle_Key_Press(), and Relache_controle().

byte Directional_up_left

Referenced by Get_input(), Handle_Joystick_Press(), and Handle_Joystick_Release().

long Directional_delay

Referenced by Get_input().

long Directional_last_move

Referenced by Get_input().

long Directional_step

Referenced by Get_input().

short Mouse_count

Referenced by Get_input(), and Move_cursor_with_constraints().

short Button_shift = -1

Referenced by Handle_Joystick_Press(), and Handle_Joystick_Release().

short Button_control = -1

Referenced by Handle_Joystick_Press(), and Handle_Joystick_Release().

short Button_alt = -1

Referenced by Handle_Joystick_Press(), and Handle_Joystick_Release().

short Button_clic_gauche = 0

Referenced by Handle_Joystick_Press().

short Button_clic_droit = 0

Referenced by Handle_Joystick_Press().