Ctrl + Shift in inputselect()

Features wanted...
Post Reply
highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Ctrl + Shift in inputselect()

Post 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
One of my scripts helped you out? Please donate via Paypal

jupe
Posts: 2757
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Ctrl + Shift in inputselect()

Post 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");

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Ctrl + Shift in inputselect()

Post by highend »

Yeah, that works. Didn't know that it can be used for this script command's window as well :oops:
Thanks!
One of my scripts helped you out? Please donate via Paypal

LittleBiG
Posts: 1846
Joined: 08 Apr 2011 12:57
Location: Win10x64

Re: Ctrl + Shift in inputselect()

Post 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.

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Ctrl + Shift in inputselect()

Post 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...
One of my scripts helped you out? Please donate via Paypal

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Ctrl + Shift in inputselect()

Post 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");
...
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Ctrl + Shift in inputselect()

Post by admin »

Ok, next version you can OK the dialog by Ctrl + Shift + Enter etc.

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Ctrl + Shift in inputselect()

Post by highend »

Muchas gracias!
One of my scripts helped you out? Please donate via Paypal

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Ctrl + Shift in inputselect()

Post 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?
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Ctrl + Shift in inputselect()

Post by admin »

Yep. Later today, before the game... :ball: :beer:

Post Reply