Archive: Shift key -> Checkbox Appears...


Shift key -> Checkbox Appears...
Hello all.

I would like to add a Checkbox to one of my install pages, however I would like it only to appear if the use holds the shift key down right before the page loads. This would be just like the current functionality of the MUI_PAGE_DIRECTORY page, where holding the shift key down while clicking next will give you the "Log install process" checkbox.

I'm looking for 2 difference though, the page I want this "Shift key activated checkbox" on is a custom page, and is also the very first page that is display when starting my installer. Is this possible? I love to be able to work it so holding down the shift(or Ctrl) key while double clicking on the installer would produce the check box on the first page (custom). Any thoughts? Thanks all.

Jnuw


You can call GetAsyncKeyState in the pre or show callback function and act upon its result, just like the directory page does for the logging option.


Originally posted by kichik
You can call GetAsyncKeyState in the pre or show callback function and act upon its result, just like the directory page does for the logging option.
Hi kichik, GetAsyncKeyState sounds like exactly what I need. I checked the NSIS help file, forums, and WIKI, but don't see any mention of this command/function. Am I missing something? Can I get an example of its use? Thanks very much.

Jnuw

It's a Windows API.

!define VK_SHIFT 0x10
System::Call "user32::GetAsyncKeyState(i ${VK_SHIFT}) i.r0"
IntOp $0 $0 & 0x8000
# $0 is not zero, if shift is pressed

kichik, thank you so much that worked beautifully!