Clicking App Designer buttons with a separately (non-mouse) controlled cursor?

2 次查看(过去 30 天)
I am making an app in App Designer that involves a user initiating the program and controlling its settings with a mouse, but once the active phase of the program starts they will be clicking on boxes with a flight stick. During this phase the flight stick will be controlling a custom 'cursor' that is separate from the mouse cursor. The boxes change position on the screen, so retrieving their position and using that to calculate their dimensions on the screen to interact with the custom cursor will be challenging, but possible. I am looking for a cleaner solution.
Is there any way to 'splice' into the Button_Pushed events that the pre-built buttons in App Designer have with a non-mouse activator that is still constrained by the GUI of said button?

回答(1 个)

Amit Dhakite
Amit Dhakite 2023-5-10
Hi Thomas,
As per my understanding, you want to get hold of “Button_Pushed” events with a non-mouse activator such as a flight stick.
The built in buttons responds to the mouse events, but not for the non-mouse activators. However, there are few workarounds you can try:
  1. Add a button in the app designer, and in its callback, try to read the values of the flight stick. After reading the values of the flight stick, you can perform the necessary actions.
  2. If you don't want to click on a button, you can use "timer()" function to continuously check the inputs from the flight stick, and once you get the desired input from the flight stick, you can perform the necessary actions.
For further information about “timer()” function, kindly refer to the following link:

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

产品


版本

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by