CEGui - keyrepeat

BlitzMax Forums/Brucey's Modules/CEGui - keyrepeat

Retimer(Posted 2009) [#1]
Key repeat is working fine for characters, but not with backspace or delete keys. Is this a bug?

Thanks


Brucey(Posted 2009) [#2]
Of CEGUI? Possibly, perhaps. My code only passes the key events through.


Retimer(Posted 2009) [#3]
Sorry, maybe 'bug' was worded wrong =p

It is an issue with the module though. I found a fix in cegui.mod/base.bmx:

	Function Keyhook:Object( id:Int, data:Object, context:Object )

		Local ev:TEvent=TEvent(data)
		If Not ev Return data
		
		Select ev.id
			Case EVENT_KEYDOWN
				TCESystem.injectKeyDown(ev.data)
			Case EVENT_KEYUP
				TCESystem.injectKeyUp(ev.data)
			Case EVENT_KEYCHAR
				TCESystem.injectChar(ev.data)
		End Select
		
		Return data
	End Function


to

	Function Keyhook:Object( id:Int, data:Object, context:Object )

		Local ev:TEvent=TEvent(data)
		If Not ev Return data
		
		Select ev.id
			Case EVENT_KEYREPEAT
				TCESystem.injectKeyDown(ev.data)
			Case EVENT_KEYDOWN
				TCESystem.injectKeyDown(ev.data)
			Case EVENT_KEYUP
				TCESystem.injectKeyUp(ev.data)
			Case EVENT_KEYCHAR
				TCESystem.injectChar(ev.data)
		End Select
		
		Return data
	End Function


Any chance this could become official?

Edit: And looking at base.bmx made me really realise just how much work you put into these modules. A lot more than just 'wrapping' going on.


Armitage 1982(Posted 2009) [#4]
Interesting addition Retimer
I didn't even notice this.


Brucey(Posted 2009) [#5]
It is an issue with the module though.

Ouch... thanks for that. Committed :-) (EDIT : beware the SVN updates.. you may get more than you bargained for)

A lot more than just 'wrapping' going on.

Depends what one considers a "wrap". But hey, if you're going to do something, you may as well do it properly, I say! :-p


Brucey(Posted 2009) [#6]
Hmmm... I wonder... should REPEAT raise both a down and an up?


Retimer(Posted 2009) [#7]
Good point.

I didn't test it much, but if it begins causing problems with 'all downs and no ups', then that might be a good idea. ...Then again, I don't really see any reason why adding injectkeyup to it would cause any harm either.

Up to you! :)


Armitage 1982(Posted 2009) [#8]
Thanks you guys.
Working great :)
About the "REPEAT up" I think it's good like that.


plash(Posted 2009) [#9]
Ooh! A key repeat event!

Unintentional help ;P