Catch all: ConnectAny(-1, CatchAll)
BlitzMax Forums/Brucey's Modules/Catch all: ConnectAny(-1, CatchAll)
| ||
Is it possible somehow catch all activity's with:ConnectAny(-1, MOBii_OnMOBii)I try catch keyboard even if a button is focused If I can catch all EventType Then I don't need to look for them ^^ |
| ||
Variables from wx.mod:\wx.mod\consts.bmxFunction MOBii_OnMOBii(_event:wxEvent) MFrame.MOBii_DoMOBii(_event) End Function Method MOBii_DoMOBii(_event:wxEvent) Local K:wxKeyEvent = wxKeyEvent(_event) Local M:wxMouseEvent = wxMouseEvent(_event) Local C:wxCommandEvent = wxCommandEvent(_event) Local D:wxInitDialogEvent = wxInitDialogEvent(_event) ' Local S:wxSheetEvent = wxSheetEvent(_event) Local U:wxUpdateUIEvent = wxUpdateUIEvent(_event) Print "_event ID: " + _event.getID() + " Type: " + _event.eventType If K Then Print "wxKeyEvent ID: " + K.getID() + " Type: " + K.eventType If M Then Print "wxMouseEvent ID: " + M.getID() + " Type: " + M.eventType If C Then Print "wxCommandEvent ID: " + C.getID() + " Type: " + C.eventType If D Then Print "wxInitDialogEvent ID: " + D.getID() + " Type: " + D.eventType ' If S Then Print "wxSheetEvent ID: " + S.getID() + " Type: " + S.eventType If U Then Print "wxUpdateUIEvent ID: " + U.getID() + " Type: " + U.eventType End MethodSome Testing: ConnectAny(wxEVT_XXXXXXX, MOBii_OnMOBii)This is Working: wxEVT_IDLE wxEVT_MOUSE_EVENTS is Working but is same as: wxEVT_MOUSEWHEEL wxEVT_MOUSEWHEEL: _event ID: -32000 Type: 115 wxMouseEvent ID: -32000 Type: 115 Origin_Keyboard: (Only Enter, Space and some other key generate Type: 1 Only) _event ID: 1 Type: 1 wxCommandEvent ID: 1 Type: 1 Not Working: wxEVT_COMMAND_LEFT_CLICK wxEVT_MOUSE_EVENTS wxEVT_LEFT_DOWN wxEVT_LEFT_DCLICK wxEVT_MOTION wxCANCEL wxYES_DEFAULT wxID_OK My thinking it's no point try convert If no _event Then NO event! I want to create something that can catch the keys from the keyboard Problem is that I want to get the key even if a wxScintilla has the focus (I want a Global GetKey that give me all the key from the Application) |
| ||
Local K:wxKeyEvent = wxKeyEvent(_event) If K Then Print "KeyCode: " + K.GetKeyCode()Problem is still howto: Connect |