Page 1 of 1

Ctrl + Shift in inputselect()

Posted: 09 Jul 2018 13:31
by highend
It would be absolutely great if inputselect() could recognize if ctrl + shift (key modifiers)
are pressed when the OK button is used / an entry double clicked.

WTF? If you execute a command via "Run..." in Windows or via pressing {WIN} and hold ctrl + shift when hitting {ENTER}, that entry is
started with admin permissions instead of the current user permissions... I'd like to emulate this behavior!

How could this be accomplished? Maybe if style = 4096 is used, the return value get's an affixed bit field info, separated via the separator= switch.
For example like in get("Trigger") with
shift = 1
ctrl = 2
alt = 4

So for example:

Code: Select all

text inputselect("", "C:\Windows\notepad.exe|C:\Windows\System32\cmd.exe", "|", 1+4096);
would return this (if ctrl + shift were held and notepad.exe was selected)

Code: Select all

3|C:\Windows\notepad.exe
and this if no key modifiers were held and cmd.exe was selected:

Code: Select all

0|C:\Windows\System32\cmd.exe

Re: Ctrl + Shift in inputselect()

Posted: 09 Jul 2018 13:40
by jupe
Not sure if this is helpful to you, but it already works like below, I have used that functionality in the past.

Code: Select all

	inputselect();
	echo get("Shift");

Re: Ctrl + Shift in inputselect()

Posted: 09 Jul 2018 14:11
by highend
Yeah, that works. Didn't know that it can be used for this script command's window as well :oops:
Thanks!

Re: Ctrl + Shift in inputselect()

Posted: 09 Jul 2018 14:36
by LittleBiG
And it is logical, if you think about it deeper. You still hold the modifiers down for a short time after clicking on the OK, and by then the code running continues on the get("shift") line.

Re: Ctrl + Shift in inputselect()

Posted: 09 Jul 2018 14:39
by highend
Mh, no, I'd still need this feature...

Why? At least here you can't select any entry via keyboard and THEN just simply execute it with Ctrl + Shift + Enter.
The OK button doesn't get triggered when doing this. Even if you select an item, switch to the "OK" button via the tab key,
hold the modifiers and hit enter. It works fine if the mouse is used, but not when doing it via keyboard only...

Re: Ctrl + Shift in inputselect()

Posted: 12 Jul 2018 21:59
by highend
At least a "fix" for the inputselect() window that the OK button can be "used" while keyboard modifiers are hold?
-> Ctrl + Shift + Enter would activate it...
In that case I could live with

Code: Select all

get("Shift");
...

Re: Ctrl + Shift in inputselect()

Posted: 14 Jul 2018 13:25
by admin
Ok, next version you can OK the dialog by Ctrl + Shift + Enter etc.

Re: Ctrl + Shift in inputselect()

Posted: 14 Jul 2018 13:55
by highend
Muchas gracias!

Re: Ctrl + Shift in inputselect()

Posted: 15 Jul 2018 11:07
by highend
It works but only when the OK button is "preselected"
E.g. an inputselect() with 32+64 doesn't allow you to directly use ctrl + shift + enter to use
the OK button (in this case with the first item (32) selected.
It requires a 2 x tab (first, switch the focus to the items in the list, second to the OK button)
to be able to use the ctrl + shift + enter.

Any chance that it works while being in the filter box, please?

Re: Ctrl + Shift in inputselect()

Posted: 15 Jul 2018 13:09
by admin
Yep. Later today, before the game... :ball: :beer: