From 352a8cb1585becb5cae6a921e8e45e4f3e5617b5 Mon Sep 17 00:00:00 2001 From: Vincent Wei Date: Thu, 13 Jun 2019 12:35:12 +0800 Subject: [PATCH] add definitions of MSG_EXIN_XXX --- include/window.h | 174 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 159 insertions(+), 15 deletions(-) diff --git a/include/window.h b/include/window.h index ff4b8039..fdd5aea3 100644 --- a/include/window.h +++ b/include/window.h @@ -1067,7 +1067,6 @@ extern DWORD __mg_interval_time; */ #define MSG_DEACTIVEMENU 0x0041 -/* Scroll bar notifying code */ /** * \defgroup ctrl_scrollbar_ncs Notification codes of srollbar control * @{ @@ -1408,55 +1407,196 @@ extern DWORD __mg_interval_time; /** * \defgroup extra_input_msgs Extra input messages + * + * In addition to the standard keyboard and mouse messages, + * MiniGUI generates extra input messages for input events from + * other input devices, including multi-touch panel, tablet pad, + * joystick, and so on. We call these messages as 'extra input messages'. + * The messages can be classified the following types: + * + * - Axis messages: the messages generated by a pointer axis like mouse wheel. + * - Button messages: the messages generated by a button on joystick. + * - Multi-touch messages: the messages generated by a multi-touch panel. + * - Gesture messages: the gesture messages. + * - Tablet messages: the messages generated by a tablet. + * - Tablet pad messages: the messages generated by a tablet pad. + * - Switch messages: the messages generated by a switch. + * - User-defined messages: the messages generated by a user-defined device. + * + * Note that the buttons other than left, right, and middle buttons on a mouse + * will be treated as generic buttons. + * + * Since 4.0.0. + * * @{ */ /* Group 4 from 0x0070 to 0x009F, the extra input messages. */ #define MSG_FIRSTEXTRAINPUTMSG 0x0070 -#define AXIS_SCROLL_VERTICAL 0 -#define AXIS_SCROLL_HORIZONTAL 1 +#define AXIS_SCROLL_INVALID 0 +#define AXIS_SCROLL_VERTICAL 1 +#define AXIS_SCROLL_HORIZONTAL 2 -#define AXIS_SOURCE_WHEEL 0 -#define AXIS_SOURCE_FINGER 1 -#define AXIS_SOURCE_CONTINUOUS 2 -#define AXIS_SOURCE_WHEEL_TILT 3 +#define AXIS_SOURCE_INVALID 0 +#define AXIS_SOURCE_WHEEL 1 +#define AXIS_SOURCE_FINGER 2 +#define AXIS_SOURCE_CONTINUOUS 3 +#define AXIS_SOURCE_WHEEL_TILT 4 /** * \def MSG_INPUT_AXIS - * \brief Indicates the user has clicked the closing box on the caption. + * \brief Indicates an axis input event. * - * This message is sent as a notification to the active window when the user + * This message is sent to the active window when the user * operates the axis of a pointer device such as a mouse. * * \code * MSG_INPUT_AXIS - * int scroll = LOSWORD (wParam); - * int source = HISWORD (wParam); - * int value = (int)lParam; + * int scroll = LOSWORD(wParam); + * int source = HISWORD(wParam); + * int value = LOSWORD(lParam); + * int value_discrete = HISWORD(lParam); * \endcode * * \param scroll one of AXIS_SCROLL_VERTICAL or AXIS_SCROLL_HORIZONTAL * \param source one of AXIS_SOURCE_WHEEL, AXIS_SOURCE_FINGER, * AXIS_SOURCE_CONTINUOUS, or AXIS_SOURCE_WHEEL_TILT. * \param value The axis value. + * \param value_discrete The axis value in discrete steps. */ #define MSG_EXIN_AXIS 0x0070 +/** + * \def MSG_EXIN_BUTTONDOWN + * \brief Indicates the user has pressed a button on joystick or + * other input device. + * + * This message is sent to the active window when the user + * pressed a button on joystick or other input device. + * + * \code + * MSG_EXIN_BUTTONDOWN + * unsigned int button = LOWORD(wParam); + * unsigned int button_count = LOWORD(lParam); + * \endcode + * + * \param button The button value. On Linux, the button values are defined + * in file, and with `BTN_` prefix. + * \param button_count The total number of buttons pressed. + */ #define MSG_EXIN_BUTTONDOWN 0x0071 + +/** + * \def MSG_EXIN_BUTTONUP + * \brief Indicates the user has released a button on joystick or + * other input device. + * + * This message is sent to the active window when the user + * released a button on joystick or other input device. + * + * \code + * MSG_EXIN_BUTTONUP + * unsigned int button = LOWORD(wParam); + * \endcode + * + * \param button The button value. On Linux, the button values are defined + * in file, and with `BTN_` prefix. + */ #define MSG_EXIN_BUTTONUP 0x0072 +/** + * \def MSG_EXIN_TOUCH_DOWN + * \brief Indicates a touch down event. + * + * \code + * MSG_EXIN_TOUCH_DOWN + * int x = LOSWORD(lParam); + * int y = HISWORD(lParam); + * \endcode + * + * \param x,y The position of touch. + */ #define MSG_EXIN_TOUCH_DOWN 0x0073 + +/** + * \def MSG_EXIN_TOUCH_UP + * \brief Indicates a touch up event. + * + * Note that this message has not any parameters. + */ #define MSG_EXIN_TOUCH_UP 0x0074 + +/** + * \def MSG_EXIN_TOUCH_MOTION + * \brief Indicates a touch move event. + * + * \code + * MSG_EXIN_TOUCH_MOTION + * int x = LOSWORD(lParam); + * int y = HISWORD(lParam); + * \endcode + * + * \param x,y The position of touch. + */ #define MSG_EXIN_TOUCH_MOTION 0x0075 + +/** + * \def MSG_EXIN_TOUCH_CANCEL + * \brief Indicates a cancelled touch event. + * + * Note that this message has not any parameters. + */ #define MSG_EXIN_TOUCH_CANCEL 0x0076 + +/** + * \def MSG_EXIN_TOUCH_FRAME + * \brief Indicates the end of a set of touchpoints at one device sample time. + * + * \code + * MSG_EXIN_TOUCH_FRAME + * unsigned int seat_slot = wParam; + * unsigned int slot = lParam; + * \endcode + * + * \param seat_slot The seat slot of the touch event. + * A seat slot is a non-negative seat wide unique identifier + * of an active touch point. + * \param slot The slot of the touch event. + * Please see the Linux kernel's multitouch protocol B documentation + * for more information. If the touch event has no assigned slot, for example, + * if it is from a single touch device, slot will be -1. + */ #define MSG_EXIN_TOUCH_FRAME 0x0077 +#define SWITCH_INVALID 0 +#define SWITCH_LID 1 +#define SWITCH_TABLET_MODE 2 + +#define SWITCH_STATE_INVALID 0 +#define SWITCH_STATE_ON 1 +#define SWITCH_STATE_OFF 2 + +/** + * \def MSG_EXIN_SWITCH_TOGGLE + * \brief Indicates the toggle event of a switch. + * + * \code + * MSG_EXIN_SWITCH_TOGGLE + * int switch_id = wParam; + * int switch_state = lParam; + * \endcode + * + * \param switch_id The identifier of the switch, one of SWITCH_LID + * or SWITCH_TABLET_MODE. + * \param switch_state The state of the switch, one of SWITCH_STATE_ON + * or SWITCH_STATE_OFF. + */ #define MSG_EXIN_SWITCH_TOGGLE 0x007A -#define MSG_EXIN_GESTRUE_SWIPE_BEGIN 0x0080 -#define MSG_EXIN_GESTRUE_SWIPE_UPDATE 0x0081 -#define MSG_EXIN_GESTRUE_SWIPE_END 0x0082 +#define MSG_EXIN_GESTURE_SWIPE_BEGIN 0x0080 +#define MSG_EXIN_GESTURE_SWIPE_UPDATE 0x0081 +#define MSG_EXIN_GESTURE_SWIPE_END 0x0082 #define MSG_EXIN_GESTURE_PINCH_BEGIN 0x0083 #define MSG_EXIN_GESTURE_PINCH_UPDATE 0x0084 #define MSG_EXIN_GESTURE_PINCH_END 0x0085 @@ -1465,10 +1605,14 @@ extern DWORD __mg_interval_time; #define MSG_EXIN_TABLET_TOOL_PROXIMITY 0x0091 #define MSG_EXIN_TABLET_TOOL_TIP 0x0092 #define MSG_EXIN_TABLET_TOOL_BUTTON 0x0093 + #define MSG_EXIN_TABLET_PAD_BUTTON 0x0094 #define MSG_EXIN_TABLET_PAD_RING 0x0095 #define MSG_EXIN_TABLET_PAD_STRIP 0x0096 +#define MSG_EXIN_USER_BEGIN 0x009A +#define MSG_EXIN_USER_UPDATE 0x009B +#define MSG_EXIN_USER_END 0x009C #define MSG_LASTEXTRAINPUTMSG 0x009F