Q on keyboard handling in LavishGUI

Discussion of Inner Space

Moderators: Lavish Software Team, Moderators

Post Reply
hendar
GamingTools Subscriber
Posts: 64
Joined: Mon Jan 22, 2007 5:36 am

Q on keyboard handling in LavishGUI

Post by hendar » Wed Mar 25, 2015 10:38 am

I'm dusting off some scripts I"ve used, and trying to improve them as I go along. I have one UI which has a lot of buttons, and I was wondering if there was some way to bind these to keyboard keypresses.

For example, I load a ui "ui -reload uiname"
This brings up a window with multiple button controls. These by default have mouse handlers (onleftclick,onrightclick).

Is there some way I can associate a keypress with each button?
When I press 'A' then the first button is pressed, etc.

The reason I ask is that I bought a G13 and would like to integrate it into this form. In other words, eventually assign a G key to a UI button/event.

PS: Is there a way I can change my forum name?

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Wed Mar 25, 2015 3:36 pm

I would really like LavishScript questions kept to ismods.com still.
Is there some way I can associate a keypress with each button?
No there is nothing built into LavishGUI to associate that, but yes of course you can use the bind command to do it.

Code: Select all

bind my-binding g13-g1 UIElement[xyz]:LeftClick
This is more or less how ISBoxer's menu management script attaches a list of hotkeys to UI buttons.

You can turn bindings like this on and off in MouseEnter/MouseExit if you want per-button bindings
PS: Is there a way I can change my forum name?
If you want to also use a different name to log into the software, yes. Otherwise we can change your forum name on ismods.com and you can ask your LS questions there as we have before ;)

hendar
GamingTools Subscriber
Posts: 64
Joined: Mon Jan 22, 2007 5:36 am

Post by hendar » Wed Mar 25, 2015 3:48 pm

Thanks Lax, sorry about the forum. It has been a while since I've asked a question.

And thanks for the answer. I'll head over there.

Post Reply