SPAS 3.0 Forums: General

You have been banned from this forum. If you have any questions, please contact the Administrator.

Sign in or create an account

You are logged in as:

Enable keyboard for ListBox

Page : 1

Reply New topic
Author Message
Community Member
Join Date: 2012-03-08
Posts: 4
Post date 03-12-2012, 21:40
#1
Is it possible to utilize the up/down keyboard keys to highlight listbox list items as though the mouse was over them, and then select that item when the enter key is pressed?

I'm currently using the :over pseudo selector to enable a color change when the mouse is over an item.
I've tried lots of different things to get the keyboard feature described above - but to no avail.

Administrator
Join Date: 2008-12-01
Location: French Riviera
Posts: 47
Post date 03-15-2012, 13:29
#2
You just have to use the "selectedIndex" property after your listbos has been populated:
lb.selectedIndex = 0;

Ps: Do not forget to use the "selected" pseudo selector :
css.appendStyle( " SelectableItem : selected { fontSize:40; } " );

Creator of SPAS 3.0

Page : 1