diku-canvas icon indicating copy to clipboard operation
diku-canvas copied to clipboard

Events only fire for one button at a time

Open casperbrahe opened this issue 7 months ago • 2 comments

@kfl

Executing interact and holding down any button will repeatedly fire KeyPress events for that button. If a second button is pressed at the same time then KeyPress events for the second button will fire repeatedly, however KeyPress events for the first button will stop.

E.g. holding down first DownArrow then UpArrow at the same time will result in the following events firing:

... DownArrow DownArrow DownArrow DownArrow DownArrow UpArrow UpArrow UpArrow UpArrow UpArrow ...

When these events should supposedly be firing:

... DownArrow DownArrow DownArrow DownArrow DownArrow UpArrow DownArrow UpArrow DownArrow UpArrow DownArrow UpArrow DownArrow UpArrow ...

Demonstrative snippet:

#r "nuget:DIKU.Canvas, 2.0"
open Canvas
open Color

let tree = ellipse darkCyan 2.0 85.0 64.0 |> translate 128.0 128.0
let draw _ = make tree
let react _ e = printfn "%A" e; None
interact "Render an image" 256 256 (Some 1000) draw react 0

casperbrahe avatar Nov 22 '23 18:11 casperbrahe