![]() |
Tips for Making GUI's Keyboard Accessible
The GUI objects are great for creating nice and easy GUIs that are navigate-able by mouse but it doesn't hurt to put in the extra effort to make them accessible by keyboard as well.
If anyone else has any other tips that are listed below feel free to post them, the main purpose of this post was to shed light on an small undocumented section of GS2. 1. Keyboard Shortcuts For buttons you can make them more 'keyboard accessible' by placing an ampersand (&) before the letter you want it to be made the shortcut key. In Graal just pressing the letter will trigger the shortcut compared to other applications where you have to hold alt and the key. Example: PHP Code:
2. Set focus to the most appropriate control after an event There isn't a control.setfocus() function for objects but you can accomplish roughly the same effect by using control.makefirstresponder(true); When you open a window set focus to the most important control they're going to use. I.e: In Zodiac's skill menu it's the skill list control. Also when you close a window make sure you set focus back to GraalControl (or even the previous window they were on) otherwise it may glitch and require the player to click the screen before they can move again. |
Thanks for the ampersand explanation. I didn't know this was available in GScript.
I wondered what that was for when I was making a menu in C++. Nice tutorial though. :) Edit: Must spread some rep before giving it to you again... |
what if you want to assign the button to a key in which the letter doesn't exist in the button text. Eg assigning apple to u
|
Quote:
|
MattKan's Mind: Okay, Gunderak, you're stupid threads aren't helping any- oh wait...
|
Quote:
http://www.buytumbleweednow.com/wp-c...ll-300x199.jpg |
Quote:
text = "Apple [&U]"; |
All times are GMT +2. The time now is 12:04 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.