Jump to content
Sign in to follow this  
EchaniDrgn

Arrow Keys to navigate between buttons.

Recommended Posts

EchaniDrgn

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

Share this post


Link to post
Share on other sites
FireFox

@EchaniDrgn

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

Cheers, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
EchaniDrgn

@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.

Share this post


Link to post
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
Sign in to follow this  

×