1 (edited by danman 2007-11-18 16:56:08)

Topic: Key events how do i stop the delay

Local receiver:IEventReceiver=IEventReceiver.create(MyEventReceiver.generate)
Type MyEventReceiver Extends IEventReceiver

    Method OnEvent:Int(event:SEvent)
        If (event.getEventType()=EET_KEY_INPUT_EVENT )
            Local key:Int=event.getKeyinputkey()
                Case EKEY_KEY_D
                    Local v:Vector3df=ship.getPosition()
                    v.setY(v.getY()-2.0)
                    ship.setPosition(v)
                    Return True
                Default
                    Return False
            EndSelect
        EndIf
        Return False

    EndMethod
    
    ' we must override the generate function in order for instantiation to work properly
    Function generate:IEventReceiver()
        Return New MyEventReceiver
    EndFunction
EndType

Hi,

Here is some event code hijacked from the example. How do i stop the keyboard using the typing delay when i press the key ??

I found the method: getKeypresseddown() on the irrlicht forums but it doesnt seem to work.



I would prefer not to use an event system at all, but instead use the keydown() and keyhit() but they are not working when im using the irrlicht mod

Re: Key events how do i stop the delay

greetings smile  because the window is instantiated by Irrlicht you cant use the built-in event system of BlitzMax.  there is a type in the addons pack called smootheventreceiver.  use this code to help emulate the behaviour of the BlitzMax event system.  just an FYI, this event mechanism is built into iB3D (i noticed youve been playing with it in another thread).

3 (edited by danman 2007-11-21 16:58:58)

Re: Key events how do i stop the delay

Ive looked through your "globals" and I think im close, but no joy yet, im getting a cannot convert message, when i change to ieventreciever i get iskeydown is not found:
Using irrlicht.ib3d

Local keyevent:ib3d_EventReceiver = ib3d_EventReceiver.generate()

While device.run()

    If keyevent.IsKeyDown( EKEY_KEY_W )
        device.drop
        End
    EndIf

Back to tryin' smile

----EDIT------

ARGH!!!!    Nevermind tongue

ib3d_keydown() !!!!!

(I feel like an engineer who has just spent an evening wondering why the device isnt working and then realising it aint plugged in!!!)