mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-22 17:18:39 +00:00
partial
This commit is contained in:
parent
c58814e703
commit
97c34ecd22
8 changed files with 68 additions and 84 deletions
|
@ -88,6 +88,17 @@ enum EEVENT_TYPE
|
|||
|
||||
};
|
||||
|
||||
//! Enumeration for "user" event types.
|
||||
enum UserEventType: s32
|
||||
{
|
||||
//! In-game touch buttons.
|
||||
/** This event is currently only fired by the in-game touch controller.
|
||||
UserData1: The GameKeyType of the button.
|
||||
UserData2: Whether the button is pressed or released.
|
||||
*/
|
||||
USER_EVENT_GAME_KEY = 1
|
||||
};
|
||||
|
||||
//! Enumeration for all mouse input events
|
||||
enum EMOUSE_INPUT_EVENT
|
||||
{
|
||||
|
@ -512,6 +523,9 @@ struct SEvent
|
|||
//! Any kind of user event.
|
||||
struct SUserEvent
|
||||
{
|
||||
//! Event code
|
||||
s32 code;
|
||||
|
||||
//! Some user specified data as int
|
||||
size_t UserData1;
|
||||
|
||||
|
|
|
@ -914,6 +914,7 @@ bool CIrrDeviceLinux::run()
|
|||
} else {
|
||||
// we assume it's a user message
|
||||
irrevent.EventType = irr::EET_USER_EVENT;
|
||||
irrevent.UserEvent.code = 0;
|
||||
irrevent.UserEvent.UserData1 = static_cast<size_t>(event.xclient.data.l[0]);
|
||||
irrevent.UserEvent.UserData2 = static_cast<size_t>(event.xclient.data.l[1]);
|
||||
postEventFromUser(irrevent);
|
||||
|
|
|
@ -947,6 +947,7 @@ bool CIrrDeviceSDL::run()
|
|||
|
||||
case SDL_USEREVENT:
|
||||
irrevent.EventType = irr::EET_USER_EVENT;
|
||||
irrevent.UserEvent.code = SDL_event.user.code;
|
||||
irrevent.UserEvent.UserData1 = reinterpret_cast<uintptr_t>(SDL_event.user.data1);
|
||||
irrevent.UserEvent.UserData2 = reinterpret_cast<uintptr_t>(SDL_event.user.data2);
|
||||
|
||||
|
|
|
@ -678,6 +678,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
case WM_USER:
|
||||
event.EventType = irr::EET_USER_EVENT;
|
||||
event.UserEvent.code = 0;
|
||||
event.UserEvent.UserData1 = static_cast<size_t>(wParam);
|
||||
event.UserEvent.UserData2 = static_cast<size_t>(lParam);
|
||||
dev = getDeviceFromHWnd(hWnd);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue