Skip to content

WOKWI simulation behaves different when using a mouse click than when using keyboard shortcut for wokwi-pushbutton #951

@GabyGold67

Description

@GabyGold67

Describe the bug
In my simulations I found several cases where using the keyboard shortcut to "press" a pushbutton behaves differently than clicking over the pushbutton image. I was working on a much complex project so I had to reduce it pretty much to have a clear idea of what was making the whole system fail. When using the mouse click everything works fine, when using the keyboard the on-screen animation doesn't show the changes in the pin outputs, and sometimes stops the simulation until the key is released (in the most complex cases.

To Reproduce
https://wokwi.com/projects/414436084308322305

Expected behavior
One pushbutton, two leds, a class that models different kind of switches out of a simple pushbutton, the objects might be disabled to ignore the pin input signal. An RTOS timer periodically disables the object to see the behavior of the pushbutton when disabled.
Pressing the pushbutton lights on the green led when the object is enabled, when the timer sets the object as disabled the red led signals it's disabled state and the green led turns off.
Works correctly when pressing the button with the mouse pointer, fails when using the "1" key. The timer is set to change the status every 5000 millisecs, while the change of lighting in the leds is frozen, the timer is still running, as keeping the 1 key pressed will block the animation, but when released the disabled status will keep it's change every 5000 milisecs.

Environment (please complete the following information):

  • OS: Windows 10
  • Chrome
  • Version v132.0.6834.84
  • Also under a virtual machine (VirtualBox) running same Windows 10, VSCode up to date with PlatformIO, the WOKWI plugin enabled.

Additional context
For this pruned example it's easy to see the implications, the https://wokwi.com/projects/415018098762515457 project just went berzek...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions