Unmapped Keys: MapWxKeyCodeToBlitz

BlitzMax Forums/Brucey's Modules/Unmapped Keys: MapWxKeyCodeToBlitz

DavidDC(Posted 2009) [#1]
Hi Brucey,

I'm getting an unmapped key message for: KEY_MINUS and KEY_EQUALS. Am I meant to be using different names?

Thanks


Brucey(Posted 2009) [#2]
I've added mappings for WXK_ADD and WXK_SUBTRACT.

Let me know if that sorts it :-)


DavidDC(Posted 2009) [#3]
Hi Brucey - I just updated and rebuilt (Ctrl +D etc). I can see your code addition at the bottom of the select list - which looks right to me. But I'm still getting the messages:

DebugLog:Unmapped key : 45
DebugLog:Unmapped key : 43


I'm using this code
	Function _OnKeyDown(_event:wxEvent)
		Local evt:wxKeyEvent = wxKeyEvent(_event)
		EmitEvent(CreateEvent( EVENT_KEYDOWN, _event.parent, MapWxKeyCodeToBlitz(evt.GetKeyCode())))
		_event.Skip()
		TAppointmentGroup(_event.parent).NotifyObservers()
	End Function


And I'm pressing the - and = keys. Their shift counterparts are _ and + and they sit on the main keyboard. XP. :-)


DavidDC(Posted 2009) [#4]
This isn't a big or urgent issue - but I've put together a little test demo. Build in debug mode and watch for any output on key press. I get unhandled keys for , . / ; ' - = ` on XP

Can others confirm?

SuperStrict

Framework wx.wxApp
Import wx.wxFrame
Import brl.standardIO

Type MyApp Extends wxApp

	Field Window:wxFrame

	Method OnInit:Int()

		Window = New wxFrame.Create(, , "Press the - and = keys",60,60,260,60)
		ConnectAny(wxEVT_KEY_DOWN, _OnKeyDown)
		Window.Show()
		
		Return True
	
	End Method
	
	Function _OnKeyDown(_event:wxEvent)
		Local evt:wxKeyEvent = wxKeyEvent(_event)
		Print "key (" + evt.GetUnicodeKey() + ") = " + evt.GetKeyCode()
		EmitEvent(CreateEvent( EVENT_KEYDOWN, _event.parent, MapWxKeyCodeToBlitz(evt.GetKeyCode())))
		_event.Skip()
	End Function

End Type

New MyApp.run()



Glenn Dodd(Posted 2009) [#5]
confirmed
also enter on the numeric keypad


Brucey(Posted 2009) [#6]
Hi Glenn!

Does your Win32 show garbage for the "GetUnicodeKey()" method too?


kenshin(Posted 2009) [#7]
Yeah confirmed.

Brucey, the GetUnicodeKey() method gives garbage for all the unhandled keys here, but works fine with the keys which worked fine using GetKeyCode().


Glenn Dodd(Posted 2009) [#8]
What Kenshin said.


DavidDC(Posted 2009) [#9]
Thanks for testing guys.


Brucey(Posted 2009) [#10]
I've just committed an update which should hopefully catch most of the key mappings now.
Keys known not to map are F13 - F19.

If anyone finds any that don't work for them, can you post it here please? (the key you pressed, and the code that didn't map). Thanks!

I haven't sorted out the unicode key value yet.