Press Ctrl+V in non AHK GUI brings up "ListVars" window

Report problems with documented functionality
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Press Ctrl+V in non AHK GUI brings up "ListVars" window

17 Sep 2017, 23:24

Code: Select all

DllCall("LoadLibrary", "Str", "XCGUI.dll", "Ptr")
DllCall("XCGUI\XInitXCGUI", "str", "")
hWindow := DllCall("XCGUI\XWnd_Create", "int", 0, "int", 0, "int", 300, "int", 200, "int", "XCGUI", "int", 0, "int", 15)
DllCall("XCGUI\XShapeText_Create", "int", 50, "int", 100, "int", "200", "int", 50, "str", "Press Ctrl+V in this window", "int", hWindow)
DllCall("XCGUI\XWnd_ShowWindow", "int", hWindow, "int", 5)
Return

Esc::ExitApp
The above code will create a simple window, but pressing Ctrl+V brings up the ListVars window.. So confused.. but then I saw the hotkey in the menu:
CtrlV.png
CtrlV.png (8.2 KiB) Viewed 1728 times
So can we limit Ctrl+V inside this window only?

Download: CtrlV-Test.7z
User avatar
TheDewd
Posts: 1510
Joined: 19 Dec 2013, 11:16
Location: USA

Re: Press Ctrl+V in non AHK GUI brings up "ListVars" window

18 Sep 2017, 11:53

The other hotkeys are affected too, of course.

Interesting that it doesn't happen using example "Example01 - Window.ahk" from your library at https://autohotkey.com/boards/viewtopic.php?t=9201
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: Press Ctrl+V in non AHK GUI brings up "ListVars" window

18 Sep 2017, 12:17

Adding XRunXCGUI can fix the issue: (which the example you mentioned have it)

Code: Select all

...
DllCall("XCGUI\XWnd_ShowWindow", "int", hWindow, "int", 5)

DllCall("XCGUI\XRunXCGUI") ; Wait until there is not XCGUI window
DllCall("XCGUI\XExitXCGUI") ; Cleanup
MsgBox, Exitting
ExitApp
However still I hope the bug can be fixed.
just me
Posts: 9451
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Press Ctrl+V in non AHK GUI brings up "ListVars" window

20 Sep 2017, 09:01

AFAICS, you create a non-GUI window AHK doesn't know anything about. For some reason, the keyboard input is passed to the script's (hiddden) main window. How should AHK prevent it?
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: Press Ctrl+V in non AHK GUI brings up "ListVars" window

20 Sep 2017, 11:38

I think checking whether the hidden main window is shown and active is enough.
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: Press Ctrl+V in non AHK GUI brings up "ListVars" window

26 Nov 2017, 23:09

Those keyboard shortcuts are implemented with the standard TranslateAccelerator system function; i.e. the function is responsible for consuming only the appropriate messages. It evidently does so correctly for every other window, so I can't see this being an AutoHotkey bug. I'm not inclined to work around a bug in a third party library.

It may be interesting to see whether the messages are actually being sent to the script's main window.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 22 guests