Jump to content

Arrow Keys to navigate between buttons.


Recommended Posts

As the title suggests I'm trying to use the arrow keys to switch between buttons in an AutoIt GUI. Is there an easy way to do this other than trapping the buttons and calculating which button to focus on?

I have 5 columns of dynamically generated buttons that disappear when clicked, I would like to be able to traverse this "grid" of buttons using the arrow keys as tab will just take me to the next button in creation order.

I'd post source, but the code is rather long, and pretty ugly.

BUTTONA1 BUTTONB1 BUTTONC1 BUTTOND1 BUTTONE1
BUTTONA2 BUTTONB2 BUTTONC2 BUTTOND2 BUTTONE2
BUTTONA3 BUTTONB3 BUTTONC3 BUTTOND3 BUTTONE3
BUTTONA4 BUTTONB4 BUTTONC4 BUTTOND4 BUTTONE4
BUTTONA5 BUTTONB5 BUTTONC5 BUTTOND5 BUTTONE5
BUTTONA6 BUTTONB6 BUTTONC6 BUTTOND6 BUTTONE6

If anyone has any simple ideas I'm all ears, just trying to make it so I don't have to use my mouse.

Clicking BUTTONA1 yields

BUTTONA2 BUTTONB1 BUTTONC1 BUTTOND1 BUTTONE1
BUTTONA3 BUTTONB2 BUTTONC2 BUTTOND2 BUTTONE2
BUTTONA4 BUTTONB3 BUTTONC3 BUTTOND3 BUTTONE3
BUTTONA5 BUTTONB4 BUTTONC4 BUTTOND4 BUTTONE4
BUTTONA6 BUTTONB5 BUTTONC5 BUTTOND5 BUTTONE5
         BUTTONB6 BUTTONC6 BUTTOND6 BUTTONE6
Link to comment
Share on other sites

@EchaniDrgn

Send("{TAB}")
;or
ControlClick()

Cheers, FireFox.

I guess I was confusing in my description of the problem.

I created the GUI in question, I'm not trying to get my script to traverse some other GUI. I would like for the down arrow to go to the next button down (default behavior), the up button to go to the next button up (default behavior), but for the left and right arrow keys to switch columns. The buttons are generated by column and where if I were to trap the left and right arrow keys and send a ton of tabs and sift-tabs to the gui I was hoping for something a little more elegant, as in an option of such.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...