P.I. Engineering User Forum

Product Support, Technical Questions and Answers, and Examples for P.I. Engineering Products

You are not logged in.

#1 2016-08-31 11:15:58

JasonDavis
Member
Registered: 2016-08-31
Posts: 5

Click on a context menu item using a keystroke

On my Windows system I have several functions in the Registry which add commands to my Windows File Explorer right click context menus.

My context menu items:

- Open file on localhost dev server (opens the file using its file path in a browser with the URL set to http://localhost/FILE_PATH_HERE
- Upload file to server - uploads a file to my server or a remote service using a program called SHareX


Currently when you right click a file it shows the context menu items in a different location depending on the position of the screen in which the click occurred.  Because of this, I cannot simply target the menu items using a pixel count relative to my click since the menu items are different on each click.

So my question would be, is there a way to map a context menu item like this to a key using some method other than the position on the screen?  I am thinking there might not be but figured I should ask anyways

Thanks

Offline

#2 2016-08-31 11:45:51

PIE Liam
Technical Support Specialist
From: Williamston, MI
Registered: 2016-01-21
Posts: 51
Website

Re: Click on a context menu item using a keystroke

You're right unless the position remains static on the screen then an absolute or relative mouse function woudl not be helpful. Is there perhaps a series of keystrokes using tabs that could get you in the right position? If so then those could certainly be programmed.

best,
Liam

Offline

#3 2016-08-31 13:40:47

JasonDavis
Member
Registered: 2016-08-31
Posts: 5

Re: Click on a context menu item using a keystroke

I found a solution....

Editing my custom context menu registry entries in Windows RegEdit app allows me to edit the registry key entry for the menu text and add & before a letter which will then make the keys Shift+letter after & select the menu item!

This image shows where I have entered the & before the letter D in windows regedit

regedit


This image shows where I used the keys shift+D and it selects my menu item which I can then send a click command to
context

Last edited by JasonDavis (2016-08-31 13:42:18)

Offline

#4 2016-08-31 13:49:55

PIE Amber
Technical Software Developer
From: Williamston, MI
Registered: 2016-01-21
Posts: 196
Website

Re: Click on a context menu item using a keystroke

Jason, that's a clever solution! Thank you for sharing this with us and other users! :)


Amber from P.I. Engineering

Offline

Board footer

Powered by FluxBB