Page 1 of 1

identify keyboard arrows

Posted: 07 May 2021, 07:50
by Alcrkai
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

Re: identify keyboard arrows

Posted: 07 May 2021, 15:18
by Alcrkai
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

Re: identify keyboard arrows

Posted: 08 May 2021, 04:15
by ahk7
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

Re: identify keyboard arrows

Posted: 09 May 2021, 06:07
by Alcrkai
Just completed I solved the problem like this:

Code: Select all

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