the event_Code for the arrow keys?

BlitzMax Forums/Brucey's Modules/the event_Code for the arrow keys?

MOBii(Posted 2016) [#1]
What is the event_Code for the Keyboard arrow keys [37, 38, 39, 40]?
	ConnectAny(wxEVT_KEY_DOWN, OnKeyDown)
	ConnectAny(wxEVT_KEY_UP, OnKeyUp)
wxEVT_KEY_UP register the arrow keys but not wxEVT_KEY_DOWN

I test: wxUP, wxDOWN, wxID_UP, wxID_DOWN, wxALL, wxEVT_NC_LEFT_DOWN, wxEVT_CHAR, wxEVT_CHAR_HOOK, wxEVT_NAVIGATION_KEY
Const wxALL:Int = wxUP | wxDOWN | wxRIGHT | wxLEFT



How can I ConnectAny Arrow key Down?


Or can it be that something turn of the event for the arrow keys?


Henri(Posted 2016) [#2]
Hi,

I'm assuming you want keydown-event from wxpanel ? Panels have wxTAB_TRAVERSAL style by default that intercepts the arrow keys. Use wxWANT_CHARS instead.



-Henri


MOBii(Posted 2016) [#3]
Thank the for the example!

The example Works
even if I manually set focus and put the event directly on the object: panel.ConnectAny
rather than ConnectAny(wxEVT_KEY_DOWN, OnKeyDown)

I have something that prevent the arrow keys ^^


Henri(Posted 2016) [#4]
In order to receive key-events from a control (like panel or button) it needs to have keyboard focus.

In this example I create a button in panel that takes focus from panel according to Windows rules. As panel loses focus it no longer receives key-events. Try uncommenting the one line marked in the example to restore focus:



-Henri