Skip to content

Invalid behavior in how runSofa propagates keys pressed to the scene. #3384

Open

Description

@damienmarchal

Problem

Description
runSofa does not propagate correctly the key pressed & release event because of the weird use of the the CTRL combination.

Steps to reproduce

import Sofa

class Test(Sofa.Core.Controller):
	def __init__(self, *args, **kwargs):
		Sofa.Core.Controller.__init__(self,*args, **kwargs)

	def onKeypressedEvent(self, event):
		print("KEY PRESSED", event)

	def onKeyreleasedEvent(self, event):
		print("KEY RELEASED", event)

def createScene(root):
	root.addObject(Test(name="Hello"))

Start a simulation and keep pressing CTRL+A key. It will print!

KEY PRESSED: {...}
KEY RELEASED: {...}
...  /// lot of repetition
KEY PRESSED: {...}
KEY RELEASED: {...}

Expected behavior
It should print a single KEY PRESSED & KEY RELEASED.

Activity

  1. damienmarchal commented on Dec 6, 2022

    @damienmarchal
    ContributorAuthor

    Again one more use case for that feature: sofa-framework/SofaPython3#184

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue: bug (minor)Bug affecting only some users or with no major impact on the framework

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions