Changing Tray Icon when script is paused - scripting

I have googled a bit, but I'm not able to find how to do this. I need custom icon when script is paused/suspended. I know how to change it on key press, but I need same functionality like when you suspend it with right mouse click in System Tray. When you do that standard AHK icon will have red background, if paused and it will change letter to "S" if suspended. My script needs to change to custom icon when it's paused/suspended, when you right-click on the icon in Tray and suspend it. No key press activation needed, eventually script need to detect when I pause/resume it and change to different custom icons.

You can change the tray icon at any time, so you can do so before you pause and return it back to normal when you unpause the script like so:
; start of script
Menu, Tray, Icon, normal.ico
; pause icon
Menu, Tray, Icon, paused.ico
Pause, On
; return to normal
Menu, Tray, Icon, normal.ico
Pause, Off
See https://www.autohotkey.com/docs/commands/Menu.htm#Icon
Edit: make your own tray menu, very basic code you need to expand to turn it on/off, simply to illustrate
Menu, Tray, Icon, normal.ico, , 1
Menu, tray, NoStandard ; removes edit, pause, reload etc
; other menu options
Menu, tray, Add, &Suspend Hotkeys , MenuHandler
Menu, tray, Icon,&Suspend Hotkeys , %A_AhkPath%, 3 ; default suspend icon
Menu, tray, Add, &Pause Script , MenuHandler
Menu, tray, Icon,&Pause Script , %A_AhkPath%, 4 ; default pause icon
;
MenuHandler:
;
If (A_ThisMenuItem = "&Pause Script")
{
Menu, Tray, Icon, paused.ico
Pause
Return
}

Related

Navigating project files in intellij idea

I want to jump through files in the project window using the up / down buttons. Now I press the down button, then press the enter button and the focus goes to the code editor window. But I do not want the focus to go away, I want to continue jumping through the files, pressing the down button and enter when I want to open the file. I can do this using this combination: down arrow, enter, F12, down arrow, down arrow, enter, F12 ...
Is there any way to tweak this to avoid using F12?
I'm using Intellij idea 2020.3
I'd suggest reassigning shortcut combination Main Menu | Window | Active Tool Window | Jump to Last Tool Window to anything more suitable for you, e.g. ESC and be sure that you don't use the same shortcut for other actions and operations.

Scroll Lock and Numb Lock Icon Notification in Auto Hot Key - AHK

I need a script that will put specific icon(that I specified) in the system tray when Scroll Lock or Numb Lock(different icons) is active. Also the script needs to hide icon when Lock or Numb is not pressed.
So far I got this:
If GetKeyState("Numlock", "T")
Menu, Tray, Icon, Shell32.dll, 174
~NumLock::
If GetKeyState("Numlock", "T")
Menu, Tray, Icon, Shell32.dll, 174
Else
Menu, Tray, Icon, Autohotkey.exe, 1
return
This is working but default AHK icon is still present in system tray; it should be hidden when Numb Lock or Scroll lock are not active.
Thanks.
From the help documentation:
The tray icon can be made to disappear or reappear at any time during the execution of the script by using the command Menu, Tray, Icon or Menu, Tray, NoIcon.
https://www.autohotkey.com/docs/commands/_NoTrayIcon.htm
Please see if the following works:
If GetKeyState("Numlock", "T")
Menu, Tray, Icon, Shell32.dll, 174
~NumLock::
If GetKeyState("Numlock", "T")
{
Menu, Tray, Icon
Menu, Tray, Icon, Shell32.dll, 174
} Else
Menu, Tray, NoIcon
Return

Intellij navigate to balloon notification link

How can I navigate to links in balloon notifications like this via the keyboard?
All the messages are logged in EventLog.
Normally it will be in bottom right corner.
There is no Keyboard shortcut assigned by default. But you add a shortcut.
Go to Settings --> Keymap
Search for Event Log and click edit
Select Add Keyboard Shortcut
Press the keys you wish to assign, If the selected key stroke is already used you will see a error message so choose a different one.

Quickly switch to layout editor in Android Studio

Is there a commmand or shortcut for quickly jump from code editor to graphical layout editor?
For example I am editing MyActivity.java and it's layout is in activity_layout.xml.
In layout editor there is a button for jumping to code, I just need reverse.
First press Ctrl+F12, then press home to jump to main Class name, for example MyActivity, then press enter and now select Navigate | Related File... ( or press Ctrl+Alt+Home in Windows or CMD+ALT+Home on mac)

Squeak smalltalk: why can't I activate the do it menu

I downloaded squeak 4.2 http://squeak.org/ and watch this very basic tutorial
http://www.youtube.com/watch?v=0w1Yub4eUAU
When I type 2 + 2 in workspace window and select right-click the line I can't get any popup menu with "do it" option.
Did I miss something ?
Depending on your platform and configuration that menu may be activated either by a right-click or a middle-click. For Squeak on Windows I believe the default is to middle-click.
If the default feels unintuitive you can invert the right and middle mouse buttons.
To invert the mouse buttons for the current image:
Click on the world background
Select open... from the World menu
Select Preference Browser
Search for mouse in the preferences
Toggle swapMouseButtons
To invert the mouse buttons on the Windows VM:
Open the system menu (small Squeak icon in the top-left window corner)
Under VM Preferrences > Mouse mapping toggle 3 button mouse
You can also activate that menu by ALT-clicking or use the quicker ALT-d shortcut for "do it".