open-cogsci / OpenSesame

Graphical experiment builder for the social sciences
http://osdoc.cogsci.nl/
GNU General Public License v3.0
234 stars 111 forks source link

restrict mouse events that trigger click #798

Closed eort closed 9 months ago

eort commented 10 months ago

All mouse events (left/right/middle click, as well as turning the wheel and what not is currently triggering mouse events. This PR limits it to left/right/middle clicks by hard coding it.

I couldn't see a benefit of making it a parameter. But maybe, we could restrict it even more? Like only left-clicks?

eort commented 9 months ago

Sure, sorry. Will do!

eort commented 9 months ago

Do you have actually some automated test battery of sorts? In this particular case with the mouse buttons, testing it is rather easy, but for bigger changes I imagine it to be quite tricky to oversee all the effects of new code, especially considering different setups, etc.

smathot commented 9 months ago

Thanks for the update!

Do you have actually some automated test battery of sorts? In this particular case with the mouse buttons, testing it is rather easy, but for bigger changes I imagine it to be quite tricky to oversee all the effects of new code, especially considering different setups, etc.

Partly. There are test cases (unittests) included with the source code which you can run with pytest. However, these only test those aspects of the code that don't require user interaction, such as parsing of OpenSesame script. Of course a lot of the functionality is about user interaction so the unittests are far from comprehensive.

It is possible to write unittests for interactions too. But that's tricky and I never got around to doing that.