Is there a keyboard shortcut to refresh project in eclipse? - eclipse

I am looking for something other than right clicking on the project and then Refresh all option. Because its painful. I'm using an older version of Eclipse (v3.5).

It's not ideal, but 'Shift-Alt-Q, P' (do the shift-alt-q combination, release all of the keys and then press 'p') brings you to the package explorer, where if you hit F5 while your project is selected, will refresh that whole project.
Like I said, not ideal, but the best I've been able to come up with.

Doesn't F5 work?
CTRL+SHIFT+L should list the keyboard shortcuts available.

Again, I can't offer an ideal solution, but an option for Windows users that find this frustrating and want a 'minimal key press' solution.
I managed to write a script for AutoHotKey that will listen to the Win+F5 key when Eclipse is the active window. If it detects the Win+F5 key, it will automatically do Brian Gruber's technique: Shift-Alt-Q, P, (EDIT 20/02/2020: I added a press of the 'Home' key, to assure the top-most project node in the package explorer is selected), followed by F5, and then followed by F12, to bring focus back to the editor.
"eclipse_Win_F5_refresh.ahk"
#IfWinActive ahk_class SWT_Window0
; Win+F5 = Refresh Eclipse project
$#F5::
Send, !+q
Send, p
Send, Home
Send, {F5}
Send, {F12}
return
So then it's just a matter of:
Save the script to a file
Install AutoHotKey
Double-click the script file to run it
Press Win-key+F5 in eclipse to get your project refresh

Related

Autohotkey Key for hiding current window

I try to close a window with the below configuration when pressing Ctrl and h.
Unfortunately it does not work.
E.g. in Chrome it opens the little window as if you press alt+space, when I focus the address bar in Chrome it works.
What do I do wrong?
;Hide a window
^h:: Send !{Space}n
Return
I managed to get a solution which fixes my issue:
I now use Kinto, which itself uses AutoHotkey, and it has the key action I want right from the start using the Mac OS Layout from the Kinto Installation Options.
Kinto itself uses AutoHotkey, you can find the AutoHotkey-file on Github.

Unsure why AHK script isn't working as intended

I use chrome bookmarks a lot, and I also often have to send people screen snippets very often, however I don't want all my bookmarks on display (some are sorta private). I know I could add them to the Other Bookmarks folder, but would rather easy access. What I've been doing for a while is hitting the bookmark shortcut (CTRL+SHIFT+B), then the snipping tool (WIN+SHIFT+S), taking my screenshot and then putting the Bookmarks back (CTRL+SHIFT+B). Eventually I decided to bite the bullet and spend some time automating it, so that hitting CTRL+SHIFT+S would close the Bookmark Bar, and letting go of the mouse (after taking the clipping) would put it back. This is what I came up with:
~#+s:: Send, ^+B
KeyWait, LButton, D
Send, ^+B
return
Although the first half works (Bookmarks go away, snipping tools open) at no point does the bar return. I've tried many things including setting up a timer, and waiting for the space bar instead of the mouse button, which i'd only hit when ready. I have also tested, and manually pressing the keys immediately after letting go the mouse button did indeed re-open the Bookmarks.
Would anyone be able to explain why this is happening? I would really appreciate any help!
First problem is that you put the first command on the same line as the hotkey definition.
This will create a one liner hotkey and the rest of the code below wont run.
Second problem is that you're sending the input to show bookmarks again while the screenshotting window is active. You're going to want to wait until chrome is active again.
This works:
#IfWinActive, ahk_exe chrome.exe
~#+s::
SendInput, ^+b
Sleep, 2000
WinWaitActive, ahk_exe chrome.exe
SendInput, ^+b
return
#IfWinActive
A bit of sleep so the screenshot window has time to open, and also added in #IfWinActive, because I'd assume you only want that hotkey to be active while you're on chrome.
Also switched over to SendInput and made the b lower case. Having it as uppercase would send Shift+B (on most keyboard layouts).

Make Shortcut key to work only if Windows Explorer is open in AHK

I have a requirement of opening my application using Ctrl + F within Windows Explorer. I think I can implement this using Auto hot key.
WinWait, Windows Explorer
{
^f::
Run "C:\myapp.exe"
return
}
But the code is not working. The code opens my application even if Windows Explorer is not open. I want Ctrl + F to be open my application only if it is active in front. I dont want to open my application even if Windows Explorer is minimized.
How can I achieve this ?
Is there any other techniques to achieve the same ?
The #IfWin directive creates context-sensitive hotkeys. Such hotkeys perform a different action depending on the type of window that is active or exists.
https://autohotkey.com/docs/commands/_IfWinActive.htm
#IfWinActive ahk_class CabinetWClass
^f::
Run "C:\myapp.exe"
return
#IfWinActive ; turn off context sensitivity
The class name of a window identifies what type of window it is.
https://autohotkey.com/docs/misc/WinTitle.htm#ahk_class

In notepad++ change tab size instantly

I'm using notepad++ (v6.5.3) and I constantly have to change the size of the tab for viewing some results. Not that it's taking me a lot of time to do it manually everytime, but it would be great if I could optimize that.
Is there a way to do so? Would a macro be the solution, or are they just for typing stuff?
Thanks a lot!
Ok, there's an easy way how you can achieve this - I have tested it right now:
Install AutoHotKey (or start portable version which runs without installation)
In Windows 7 and above, ensure you launched AutoHotKey as Administrator (otherwise you get inconsistencies in its behavior) - if not sure, exit it and restart it as administrator
Right click Autohotkey tray icon and select Edit This Script
Import the macro below this list at the end of the AutoHotKey script file and save the file
Right click Autohotkey tray icon and select Reload This Script.
–– This was end of general steps, now let's go with your macro: ––
In N++, display Preferences window and press its Close button1 at the bottom (NOT at the top-right corner)
Now you can use shortcuts Win+F2 and Win+F3 to switch different tab sizes instantly
SendMode Input
DetectHiddenWindows, On
SetTitleMatchMode, RegEx
;--------------------------------- Hotkeys for Notepad++ only
#IfWinActive ahk_class Notepad\+\+
#F2::Send {F10}{Right 6}{Down}{Enter}{Tab 2}{Space}16{Enter}{Tab 3}{Space}
#F3::Send {F10}{Right 6}{Down}{Enter}{Tab 2}{Space}4{Enter}{Tab 3}{Space}
#IfWinActive
1) Important: N++ user experience provided in dialog boxes is absolutely terrible. There are no anchors where you can fix focus when using keyboard. Thus you always need to perform step 4 manually when leaving Preferences dialog box otherwise the macros would send keys into incorect window page OR at correct page but incorrect control. Preferences dialog window remembers selected page and control. Macros I created for you therefore assume that correct page is already listed and button Close was recently focused.
Good news is Notepad++ windows with this weird behavior are rare exception from general user experience. In other places in N++ (or in other apps) where user interface components (menus, dialogs etc.) always start from the same point you do not need any special precautions like the one in step 4.
Adjust the macros as you like:
you can create more of them
you can adjust the numbers "16" and "4" typed into tab size input box
you can change shortcut keys to something else
you can replace sending keys with sending mouse clicks at desired screen/window positions
you can achieve many other useful shortcuts in N++ and in all other apps – check AHK deeper!

Menu Item in AHK

I'm switching from keyboard maestro and mac, to AHK and Windows.
I'd like to choose a menu item in Thunderbird, say,
"Message>Move to>me#email.com>Archive".
Or I'd like to choose bookmark "2checkvist" in Chrome.
How do I create hotkeys to menu items? And how do I keep them to only that program, so that alt+t in chrome can do one thing, while alt+t in thunderbird does another thing?
As Jan Dvorak says, look at ifWinActive in the docs (I should get a point for posting the link to docs, you know).
Then you can use send with the alt key, something like this (you have to expiriment).
ifwinexist thunderbird
{
winactivate thunderbird
send !m ;message menu
send m ;move to (if you have more m-commands, then you have to send this more than once till you get to it)
send something ;here put keys until you get to your account
send a ;archive
}
Basically, you want ahk to use the alt menu keys. Everyone's interface differs a little depending on your addons and version. In your main interface, hold down the alt key and look at your menu bar. You will see that little underlines appear under certain letters. This is your "alt" key command. Now, figure out the sequence. You only need to push alt once to open the "alt thread" - now navigate manually through the menus using your keyboard. Now translate that sequence into autohotkey send commands.
You might also have to use activateWindow to assure your alt key will take correctly.