Skip to content

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

@damienmarchal

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.

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