2 * Copyright (C) 2005-2023 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
11 #include "Resolution.h"
12 #include "input/keyboard/XBMC_keyboard.h"
14 /* Event enumerations */
17 XBMC_NOEVENT
= 0, /* Unused (do not remove) */
18 XBMC_KEYDOWN
, /* Keys pressed */
19 XBMC_KEYUP
, /* Keys released */
20 XBMC_KEYCOMPOSING_COMPOSING
, /* A composed key (sequence) is under processing */
21 XBMC_KEYCOMPOSING_FINISHED
, /* A composed key is finished */
22 XBMC_KEYCOMPOSING_CANCELLED
, /* A composed key is cancelled */
23 XBMC_MOUSEMOTION
, /* Mouse moved */
24 XBMC_MOUSEBUTTONDOWN
, /* Mouse button pressed */
25 XBMC_MOUSEBUTTONUP
, /* Mouse button released */
26 XBMC_QUIT
, /* User-requested quit */
27 XBMC_VIDEORESIZE
, /* User resized video mode */
28 XBMC_SCREENCHANGE
, /* Window moved to a different screen */
29 XBMC_VIDEOMOVE
, /* User moved the window */
30 XBMC_MODECHANGE
, /* Video mode must be changed */
32 XBMC_BUTTON
, /* Button (remote) pressed */
36 XBMC_MAXEVENT
= 256 /* XBMC_EventType is represented as uchar */
39 /* Keyboard event structure */
40 typedef struct XBMC_KeyboardEvent
{
44 /* Mouse motion event structure */
45 typedef struct XBMC_MouseMotionEvent
{
46 uint16_t x
, y
; /* The X/Y coordinates of the mouse */
47 } XBMC_MouseMotionEvent
;
49 /* Mouse button event structure */
50 typedef struct XBMC_MouseButtonEvent
{
51 unsigned char button
; /* The mouse button index */
52 uint16_t x
, y
; /* The X/Y coordinates of the mouse at press time */
53 } XBMC_MouseButtonEvent
;
55 /* The "window resized" event
56 When you get this event, you are responsible for setting a new video
57 mode with the new width and height.
59 typedef struct XBMC_ResizeEvent
{
60 int w
; /* New width */
61 int h
; /* New height */
64 typedef struct XBMC_MoveEvent
{
65 int x
; /* New x position */
66 int y
; /* New y position */
69 typedef struct XBMC_ScreenChangeEvent
71 unsigned int screenIdx
; /* The screen index */
72 } XBMC_ScreenChangeEvent
;
74 struct XBMC_ModeChangeEvent
79 /* The "quit requested" event */
80 typedef struct XBMC_QuitEvent
{
83 /* A user-defined event type */
84 typedef struct XBMC_UserEvent
{
85 int code
; /* User defined event code */
86 void *data1
; /* User defined data pointer */
87 void *data2
; /* User defined data pointer */
90 /* Multimedia keys on keyboards / remotes are mapped to APPCOMMAND events */
91 typedef struct XBMC_AppCommandEvent
{
92 unsigned int action
; /* One of ACTION_... */
93 } XBMC_AppCommandEvent
;
95 /* Mouse motion event structure */
96 typedef struct XBMC_TouchEvent
{
97 int action
; /* action ID */
98 float x
, y
; /* The X/Y coordinates of the mouse */
99 float x2
, y2
; /* Additional X/Y coordinates */
100 float x3
, y3
; /* Additional X/Y coordinates */
101 int pointers
; /* number of touch pointers */
104 typedef struct XBMC_SetFocusEvent
{
105 int x
; /* x position */
106 int y
; /* y position */
107 } XBMC_SetFocusEvent
;
109 /* Button event structure */
110 typedef struct XBMC_ButtonEvent
116 /* General event structure */
117 typedef struct XBMC_Event
{
121 XBMC_KeyboardEvent key
;
122 XBMC_MouseMotionEvent motion
;
123 XBMC_MouseButtonEvent button
;
124 XBMC_ResizeEvent resize
;
126 XBMC_ModeChangeEvent mode
;
129 XBMC_AppCommandEvent appcommand
;
130 XBMC_TouchEvent touch
;
131 XBMC_ButtonEvent keybutton
;
132 XBMC_SetFocusEvent focus
;
133 XBMC_ScreenChangeEvent screen
;