identify keyboard arrows

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Alcrkai
Posts: 47
Joined: 16 Mar 2021, 10:51

identify keyboard arrows

Post by Alcrkai » 07 May 2021, 07:50

how do I make it display messages using the arrow keys as well, the way it now works only using the mouse

Code: Select all

Class	GuiConfig	{
Cores(id="")	{
if(Strlen(id)>0)	{
Gui,	%id%:Color,	,dbdbdb
Gui,	%id%:Color,	425942
}	else	{
Gui,	Color,	,dbdbdb
Gui,	Color,	425942
}
}
}

GuiConfig.Cores()
Gui, Add, ListView, x62 y39 w350 h200 grid gvai +AltSubmit, teste                                                                                                    |        av
LV_ModifyCol(2, -1)
Gui, Add, Edit, x62 y249 w350 h100 vEdit01, 
Gui, add, button, w200 ggo,add
Gui, Show, w479 h379, Untitled GUI
return
go:
av1 = av_test1
av2 = av_test2
av3 = av_test3
t1 = test1
t2 = test2
t3 = test3
LV_Add("",t1,av1)
LV_Add("",t2,av2)
LV_Add("",t3,av3)
return
vai:
Gui, Submit,	NoHide
Row := A_EventInfo
;~ if(A_GuiEvent="Normal" or A_GuiEvent="Up" or A_GuiEvent="Down")
;~ if(A_GuiEvent="Normal" or A_GuiEvent=Up or A_GuiEvent=Down)
;~ if(A_GuiEvent="Normal" or A_GuiEvent={Up} or A_GuiEvent={Down})
if(A_GuiEvent="Normal")
	LV_GetText(ob, Row ,2)
	GuiControl, , Edit01, % ob
return
GuiClose:
ExitApp

Alcrkai
Posts: 47
Joined: 16 Mar 2021, 10:51

Re: identify keyboard arrows

Post by Alcrkai » 07 May 2021, 15:18

It is possible to make this code send what is in the second column (which is hidden) to Edit, it works if I click with the mouse but I wanted it to work with the arrow keys too

ahk7
Posts: 574
Joined: 06 Nov 2013, 16:35

Re: identify keyboard arrows

Post by ahk7 » 08 May 2021, 04:15

Add hotkeys for the active gui, it also works if the focus is on the edit control which may or may not be want you want but easily fixed if need be

Code: Select all

Class	GuiConfig	{
Cores(id="")	{
if(Strlen(id)>0)	{
Gui,	%id%:Color,	,dbdbdb
Gui,	%id%:Color,	425942
}	else	{
Gui,	Color,	,dbdbdb
Gui,	Color,	425942
}
}
}

GuiConfig.Cores()
Gui, Add, ListView, x62 y39 w350 h200 grid gvai +AltSubmit, teste                                                                                                    |        av
LV_ModifyCol(2, -1)
Gui, Add, Edit, x62 y249 w350 h100 vEdit01, 
Gui, add, button, w200 ggo,add
Gui, Show, w479 h379, Untitled GUI
return
go:
av1 = av_test1
av2 = av_test2
av3 = av_test3
t1 = test1
t2 = test2
t3 = test3
LV_Add("",t1,av1)
LV_Add("",t2,av2)
LV_Add("",t3,av3)
return
vai:
Gui, Submit,	NoHide
;Row := A_EventInfo
Row :=LV_GetNext()
;~ if(A_GuiEvent="Normal" or A_GuiEvent="Up" or A_GuiEvent="Down")
;~ if(A_GuiEvent="Normal" or A_GuiEvent=Up or A_GuiEvent=Down)
;~ if(A_GuiEvent="Normal" or A_GuiEvent={Up} or A_GuiEvent={Down})
;if(A_GuiEvent="Normal")
LV_GetText(ob, Row ,2)
GuiControl, , Edit01, % ob
return
GuiClose:
ExitApp

#IfWinActive, Untitled GUI
Up::
Down::
ControlSend, SysListview321, {%A_ThisHotkey%}, Untitled GUI
Gosub, Vai
Return
#IfWinActive

Alcrkai
Posts: 47
Joined: 16 Mar 2021, 10:51

Re: identify keyboard arrows

Post by Alcrkai » 09 May 2021, 06:07

Just completed I solved the problem like this:

Code: Select all

if(A_GuiEvent="Normal" or A_ThisHotkey=Up or A_ThisHotkey=Down)

Post Reply

Return to “Ask for Help (v1)”