CEGui - keyrepeat

BlitzMax Modules Forums/Brucey's Modules/CEGui - keyrepeat

Key repeat is working fine for characters, but not with backspace or delete keys. Is this a bug?

Thanks

Of CEGUI? Possibly, perhaps. My code only passes the key events through.

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.

Interesting addition Retimer
I didn't even notice this.

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

Hmmm... I wonder... should REPEAT raise both a down and an up?

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! :)

Thanks you guys.
Working great :)
About the "REPEAT up" I think it's good like that.

Ooh! A key repeat event!

Unintentional help ;P