+
Skip to content

PolledInput flushes keys/mousebutton on suspend/resume #16

@GWRon

Description

@GWRon

Create a simple graphical window.

SuperStrict
'Framework Brl.Retro
Import Brl.Graphics
Import Brl.GLMax2D
Import Pub.Win32



SetGraphicsDriver GLMax2DDriver()
Graphics 800,600


Function MyHook:Object( id:Int,data:Object,context:Object )
	Local ev:TEvent=TEvent(data)
	If Not ev Return data

	Print "event: "+ev.id +"  data="+ev.data	
End Function
AddHook EmitEventHook,MyHook,Null,0

While Not (KeyHit(KEY_ESCAPE) Or AppTerminate())
 	DrawText "A = "+KeyDown(KEY_A), 0, 200

	Flip
	Cls
Wend

Hold "A" and Alt-Tab (needed, as clicking "somewhere into another window" does not emit suspend-events).
Keep holding "A" and Alt-Tab back into your window.

For BlitzMax "A" is no longer "down/hold" - as it flushes keys / mouse buttons.

Ok. If you now removed the flushkeys/flushmouse commands when suspending/resuming your app, you could release "A" while suspended but for blitzmax it is "down/hold" when alt-tabbing in again - and it keeps "hold" until you tap "A" again.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载