Listbox and the ENTER key Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
braunbaer
Posts: 478
Joined: 22 Feb 2016, 10:49

Listbox and the ENTER key

Post by braunbaer » 04 Dec 2021, 08:52

When I click or doubleclick an item of a listbox, the corresponding g- routine is called.
Is it possible to get ANY kind of reaction when I hit the enter key? I would like to be able to choose en entry with the arrow keys and then hit enter, but the enter key does not produce any reaction.

As a workaround, I could make "enter" a conditional hotkey, but isnt it possible to achieve that in a more natural way?

User avatar
mikeyww
Posts: 26754
Joined: 09 Sep 2014, 18:38

Re: Listbox and the ENTER key  Topic is solved

Post by mikeyww » 04 Dec 2021, 08:57

Code: Select all

Gui, Font, s10
Gui, Add, ListBox, w200 r5 vcolor, Red||Green|Blue|Black|White
Gui, Add, Button, xm ym Hidden Default, OK
Gui, Show,, Test
Return

ButtonOK:
Gui, Submit
MsgBox, 64, Result, You picked %color%.
Return

braunbaer
Posts: 478
Joined: 22 Feb 2016, 10:49

Re: Listbox and the ENTER key

Post by braunbaer » 04 Dec 2021, 15:17

:thumbup: :thumbup: :thumbup:

Thank you!

Post Reply

Return to “Ask for Help (v1)”