indigo-astronomy / indigo_imager

INDIGO Imager App
Other
9 stars 5 forks source link

Add keyboard shortcuts for moving telecope mount #18

Closed nicospor closed 1 month ago

nicospor commented 2 months ago

This PR adds keyboard shortcuts for mount movement buttons in the "Telescope" tab of Ain Imager. The bindings are (button_name -> key):

These keys (W, A, D, S, Space) were chosen to resemble key bindings usually used in gaming for movement and to leave arrow keys free to be potentially bound to something else in the future.
It could be useful for people who don't have a joystick, for example (like me at the moment... :smile:), and prefer using the keyboard over the mouse.

Tested with "Mount Simulator" on Linux Ubuntu 22.04 "Jammy" with INDIGO Server v. 2.0-282. I haven't been able to compile and test on Windows yet.

I'm not very knowledgeable about C++ and Qt so maybe this should be reviewed for potential memory leaks or other bugs, although is a very small feature (it uses the addShortcut method on the QPushButton object).

Many thanks for all the great work with INDIGO.

rumengb commented 1 month ago

I am sorry I can not accept this patch as it interferes with the normal workflow. Space is used to change the selection in a widget like a checkbox. With this patch, you can select the widget but instead of changing the widget state, it will stop the mount. This is not how it is supposed to work. It is also dangerous because a single key will move the mount, and during the night when you are sleepy you may want to type something, let us say in the browser, but without paying enough attention Ain is active and you accidentally move the mount in the middle of the exposure. And what is worse you may not even realize what you have done.

nicospor commented 1 month ago

Ok, I understand, sorry to have wasted your time.