List Complete without Enter Key

I am using the list search feature in list boxes of various programs and I would like to know if it is possible to change the default behavior when pressing enter in listary.


1.) I open a dialog with a listbox
2.) I click into the listbox and start typing
3.) Listary comes up and shows me its results and the listbox automatically jumps to the entry.
4.) I press Enter to select the entry. Listary sends the Enter key to the listbox.
5.) The program closes the dialog with the selected list entry.

but I would like

4.) I press Enter (or something else). Listary double clicks the list entry.
5.) The program keeps the dialog open and starts an action for the list item.

I understand that this is totally program dependent, but most programs seem to do the right thing on double click as well.

Is it possible?

Hi, could you tell me the reason that you’d like to change Enter to double clicking?

Pressing Enter will Accept the selection and close the dialog (what I don’t want).

Double click will add the entry to the items to work on (and not close the dialog).

The program shown is Apple Filemaker.

Unfortunately simulating mouse double-click is much less reliable than simulating keyboard press. I can’t change this currently.

I agree that Enter is the default for most programs, but it might be nice to customize the behavior for some applications.

I have coded this (AutoHotKey), which will do what I want if I press Alt+Enter: Double click the selected list item.

#SingleInstance Force

 	ControlGetFocus, currentFocusControl, A
	if ErrorLevel
	if( currentFocusControl <> "SysListView321")

	ControlGet, focusedRow, List, Count Focused, %currentFocusControl%, A
	ControlGet, listviewHandle, Hwnd, , %currentFocusControl%, A 
	LV_DoubleClickRow(listviewHandle, focusedRow)


Helper function:

; From "Just me"
LV_DoubleClickRow(HLV, Row) 
   ; HLV : ListView's HWND, Row : 1-based row number
   HPROC := 0
   MyPID := DllCall("GetCurrentProcessId", "UInt")
   WinGet, LVPID, PID, ahk_id %HLV%
   If !(LVPID)
      Return False
   VarSetCapacity(RECT, 16, 0)
   If (LVPID <> MyPID) {
      If !(HPROC := DllCall("OpenProcess", "UInt", 0x0438, "Int", False, "UInt", LVPID, "Ptr"))
         Return False
      If !(Addr := DllCall("VirtualAllocEx", "Ptr", HPROC, "Ptr", 0, "UPtr", 16, "UInt", 0x1000, "UInt", 4, "UPtr"))
         Return (DllCall("CloseHandle", "Ptr", HPROC) & 0) ; False
      Addr := &RECT
   SendMessage, 0x1013, % (Row - 1), 1, , ahk_id %HLV% ; LVM_ENSUREVISIBLE
   SendMessage, 0x100E, % (Row - 1), %Addr%, , ahk_id %HLV% ; LVM_GETITEMRECT
   If (HPROC) {
      DllCall("ReadProcessMemory", "Ptr", HPROC, "Ptr", Addr, "Ptr", &RECT, "UPtr", 16, "Ptr", 0)
      DllCall("VirtualFreeEx", "Ptr", HPROC, "Ptr", Addr, "UPtr", 0, "UInt", 0x8000)
      DllCall("CloseHandle", "Ptr", HPROC)
   POINT := NumGet(RECT, 0, "Short") | (NumGet(RECT, 4, "Short") << 16)
   PostMessage, 0x0201, 0, POINT, , ahk_id %HLV% ; WM_LBUTTONDOWN
   PostMessage, 0x0202, 0, POINT, , ahk_id %HLV% ; WM_LBUTTONUP
   PostMessage, 0x0203, 0, POINT, , ahk_id %HLV% ; WM_LBUTTONDBLCLK
   PostMessage, 0x0202, 0, POINT, , ahk_id %HLV% ; WM_LBUTTONUP
   Return True