BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
PavelD
Obsidian | Level 7
Hi!

I'm following up on this closed thread:
https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-keyboard-shortcuts-previously-open-drop-d...

I cannot comment on that anymore.
Any news from the development team?

In particular, is there already a keyboard shortcut to switch between different open programs?

I tried to force autohotkey to "click" on the drop-down menu where the programs are listed, but with no success.

Any ideas or autohotkey snippets would be much appreciated! Thank you!
1 ACCEPTED SOLUTION

Accepted Solutions
PavelD
Obsidian | Level 7

So here is my attempt how to simulate opening drop down menu (listing open programs) in two windows, such as here in the picture (red boxes😞

 

sas autohotkey.png

 

Code explained:

1) The dropdowns are located on the upper bars. Click somewhere on the upper bar and retrieve the ClassNN of these bars via MouseGetPos.

1) Get the coords of the upper left corner of the control (see the green X in the picture above).

2) Offset a little bit from the corners so the cursor is in the middle of the dropdown.

3) Click twice, with 250ms in between clicks (one click is not enough for some reason). Note: ControlClick does not work. Change the delay if needed.

4) Move cursor back where it was originally.

5) Hotkeys Alt+Left or Alt+Right to show dropdown menu in the left or right window.

 

ConGetPos(RightQ)
{
	;get control ClassNN of the upper bars where the dropdowns are located
	LeftBoxX = 350 ;approx location of the left bar
	LeftBoxY = 75
	RightBoxX = 1350 ;approx location of the right bar
	RightBoxY = 75
	SetMouseDelay, 0
	MouseGetPos, CurrX, CurrY
	if (RightQ = 0)
		{
		MouseMove, %LeftBoxX%, %LeftBoxY%
		MouseGetPos, , , , ClassAtPos
		}
	if (RightQ = 1)
		{
		MouseMove, %RightBoxX%, %RightBoxY%
		MouseGetPos, , , , ClassAtPos
		}	

	ControlGetPos, xCon, yCon, ,, %ClassAtPos%
	xShifted:=xCon+15
	yShifted:=yCon+15	
Click, %xShifted% %yShifted% sleep 250 Click, %xShifted% %yShifted%
MouseMove, %CurrX%, %CurrY% } !Left::ConGetPos(0) !Right::ConGetPos(1)

 

EDIT: First version of the code was very unstable (the ClassNN of the upper bars changes often and cannot be hardcoded).

 

ADDED 2018-07-03: Toggle between the right and left editor windows

If you have an older version of SAS EG (V7.12 in my case), the command F6 might not work.

Here is autohotkey workaround (keyboard shortcut RightShift+Tab):

 

; toggle between the right and left editor windows
; Right Shift+Tab
RShift & Tab::
;get control ClassNN of the left and right editor
	; first let's find 
	LeftEditorX = 350 ;approx location of the left editor window
	LeftEditorY = 400
	RightEditorX = 1350 ;approx location of the right editor window
	RightEditorY = 400
	SetMouseDelay, 0
	;save current coords
	MouseGetPos, CurrX, CurrY
	
	; pos of the left editor
	MouseMove, %LeftEditorX%, %LeftEditorY%
	MouseGetPos, , , , ClassAtPosLeft
	
	; pos of the right editor
	MouseMove, %RightEditorX%, %RightEditorY%
	MouseGetPos, , , , ClassAtPosRight
	; what is the class under the caret?
	MouseMove, %A_CaretX%, %A_CaretY%
	MouseGetPos, , , , CurrentCaretClass
	;toggle
	if (CurrentCaretClass = ClassAtPosLeft)
		ControlFocus, %ClassAtPosRight%
	else
		ControlFocus, %ClassAtPosLeft%

	MouseMove, %CurrX%, %CurrY%
return

View solution in original post

5 REPLIES 5
ChrisHemedinger
Community Manager

There isn't a direct key for this.  Use Shift+F6 to navigate among the main panes of your workspace, then arrow/Enter to select content in there (like programs from a list in your project tree).  You might be able to come up with an AutoHotkey script that does this for you.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
PavelD
Obsidian | Level 7
Thanks Chris. I seem to have the same problem as the author of the original post - F6 and Shift+F6 does not work in the editor window.

Re autohotkey script - I was exactly hoping somebody could share her/his code. I failed to produce anything usable. Thank you
ChrisHemedinger
Community Manager

Can you tell us what version of EG you're using?  Shift+F6 works for me with v7.15.

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
PavelD
Obsidian | Level 7
7.12 HF7 (7.100.2.3491) (64-bit)
platform version 9.4.3.0
PavelD
Obsidian | Level 7

So here is my attempt how to simulate opening drop down menu (listing open programs) in two windows, such as here in the picture (red boxes😞

 

sas autohotkey.png

 

Code explained:

1) The dropdowns are located on the upper bars. Click somewhere on the upper bar and retrieve the ClassNN of these bars via MouseGetPos.

1) Get the coords of the upper left corner of the control (see the green X in the picture above).

2) Offset a little bit from the corners so the cursor is in the middle of the dropdown.

3) Click twice, with 250ms in between clicks (one click is not enough for some reason). Note: ControlClick does not work. Change the delay if needed.

4) Move cursor back where it was originally.

5) Hotkeys Alt+Left or Alt+Right to show dropdown menu in the left or right window.

 

ConGetPos(RightQ)
{
	;get control ClassNN of the upper bars where the dropdowns are located
	LeftBoxX = 350 ;approx location of the left bar
	LeftBoxY = 75
	RightBoxX = 1350 ;approx location of the right bar
	RightBoxY = 75
	SetMouseDelay, 0
	MouseGetPos, CurrX, CurrY
	if (RightQ = 0)
		{
		MouseMove, %LeftBoxX%, %LeftBoxY%
		MouseGetPos, , , , ClassAtPos
		}
	if (RightQ = 1)
		{
		MouseMove, %RightBoxX%, %RightBoxY%
		MouseGetPos, , , , ClassAtPos
		}	

	ControlGetPos, xCon, yCon, ,, %ClassAtPos%
	xShifted:=xCon+15
	yShifted:=yCon+15	
Click, %xShifted% %yShifted% sleep 250 Click, %xShifted% %yShifted%
MouseMove, %CurrX%, %CurrY% } !Left::ConGetPos(0) !Right::ConGetPos(1)

 

EDIT: First version of the code was very unstable (the ClassNN of the upper bars changes often and cannot be hardcoded).

 

ADDED 2018-07-03: Toggle between the right and left editor windows

If you have an older version of SAS EG (V7.12 in my case), the command F6 might not work.

Here is autohotkey workaround (keyboard shortcut RightShift+Tab):

 

; toggle between the right and left editor windows
; Right Shift+Tab
RShift & Tab::
;get control ClassNN of the left and right editor
	; first let's find 
	LeftEditorX = 350 ;approx location of the left editor window
	LeftEditorY = 400
	RightEditorX = 1350 ;approx location of the right editor window
	RightEditorY = 400
	SetMouseDelay, 0
	;save current coords
	MouseGetPos, CurrX, CurrY
	
	; pos of the left editor
	MouseMove, %LeftEditorX%, %LeftEditorY%
	MouseGetPos, , , , ClassAtPosLeft
	
	; pos of the right editor
	MouseMove, %RightEditorX%, %RightEditorY%
	MouseGetPos, , , , ClassAtPosRight
	; what is the class under the caret?
	MouseMove, %A_CaretX%, %A_CaretY%
	MouseGetPos, , , , CurrentCaretClass
	;toggle
	if (CurrentCaretClass = ClassAtPosLeft)
		ControlFocus, %ClassAtPosRight%
	else
		ControlFocus, %ClassAtPosLeft%

	MouseMove, %CurrX%, %CurrY%
return

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1915 views
  • 3 likes
  • 2 in conversation