Using the §-key instead of the TAB key in ALT+TAB with Autohotkey - autohotkey

I have a need to use something else than the TAB key to achieve ALT+TAB functionality in Windows 10. (long story short - I'm using Parallells and remote desktop on a Mac, and need to keep the Remote Desktop setting "Apply Windows Key Combinations" set to "On this computer", so I can't just forward everything to the remote computer).
Using Autohotkey on the remote computer, I thought I could simply do something like
§::Send {Tab}
to be able to press ALT+§ instead of ALT+TAB, and have Parallells ignore it and just forward it as any other key (for example SHIFT+A to type an "A"). But it doesn't seem to work that way, nothing happens when holding down ALT and pressing § except a "pling" sound. Just pressing § alone prints a TAB character if I'm in a text editor.
I tried
^!§::Send ^!{Tab}
as well, same result.
For now I settled on using the following script instead, which lets me press § to bring up the ALT+TAB window, where I can either use arrow keys or the § key to select an application, and then Enter to switch to it:
§::Send ^!{Tab}
This is not bad, but it's annoying to have to use the Enter key to activate the window. So, is there any way to simply replace ALT+TAB with ALT+§ and get the normal functionality of the ALT+TAB window-switcher?

Use the hotkey <!§::AltTab.
<! means left alt and you can read more about AltTab here.
Also, AltTabMenuDismiss might be worth looking into related to the problem you outlined in the comments.

Related

Close Quick Panel (window.show_quick_panel) on key release in Sublime Text

I am new to sublime text plugin development, I am developing a plugin that involves opening a quick panel on pressing certain key binding. I want the panel to be open only as long as the keys are pressed and once the keys are released I want it (Quick panel) to close. I've figured out I can fire the 'hide_pannel' command to close my Quick panel but I want it to fire on release of the key combination.
For example lets say, I want the quick panel on pressing Ctrl+p and I want it to close after I release ctrl.
So I was thinking if I fire 'hide_pannel' command after release ctrl should do the trick, but I couldn't find how I can fire a certain command on key release instead of key press. If there is any other solution or workaround other than what I was thinking please do let me know.
Although you can detect when a key is pressed in Sublime, you can't directly detect when it has been released. Similarly, the modifier keys (Ctrl, Alt, etc) can not be mapped to anything on their own and always require a non-modifier as well. For example, Ctrl+P is allowed, but Ctrl alone is not.
That said, theoretically it's possible to interface with the underlying operating system using a python library that uses native code in your plugin to observe the state of the keyboard.
I'm not aware of any Sublime specific examples of doing such a thing, however. Note also that in doing this you would also have to provide such a library for all of the platforms that Sublime supports (Windows, MacOS, Linux, and 32 or 64 bit versions on Windows/Linux), presuming that you want your plugin to work on multiple platforms.

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.

Emacs keyboard changed

Several times now while programming in Emacs my keyboard has started to write Greek letters into the buffer. I assumed that I'd pressed some key combination but after searching I've yet to figure out what it is and my only solution right now is to restart Emacs. So what am I doing and how do I fix it?
Try to analyse what you've pressed.
M-x list-command-history shows command history
C-h l runs the command view-lossage which displays last 300 input keystrokes
I'm going out on a limb.
You're working on a windows computer that has multiple input languages configured (including greek). It also has the default keyboard shortcut to switch between them enabled (left alt+shift is the default, and if you have multiple inputs set up, it is on by default).
Some emacs shortcuts require an alt-shift combo, and depending on the order you press them, you get or don't get windows intercepting it for the IME switch.
Possible solutions include:
remove the greek IME
disable the windows shortcut to switch IMEs
change said shortcut
I typically want multiple IMEs on my systems, like that I can switch IMEs quickly, and don't want to mess with default shortcuts, so I ended up getting used to always pressing shift then alt when doing alt-shift combos in emacs.

Ctrl Space Not Working in Eclipse Helios on Win 7

I have shifted by Dev Env recently to Eclipse Helios on Windows 7. After that the Ctrl + Space Content Assist feature is not working. I found out that that key option is utilized by Language Settings. I have tried disabling it. But it still doesn't work in Eclipse.
Any help is much appreciated.
Configure Eclipse’s content assist, go “Preferences>Java>Editor>Content Assist>Advanced“. Make sure “Other Java Proposals” is ticked.
http://www.mkyong.com/java/content-assist-ctrl-space-is-not-working-eclipse/
In my case nothing happens after pressing Ctrl+Space. Right now I have set a different short cut for the same and solved
Check your "Keys" preferences: maybe the Content Assist" shortcut has been overridden by another command which would also use Ctrl+Space.
That could happen with the installation of a new plugin, coming with its own set of commands and shortcuts: the bug 303894 for the XText plugin is a good example.
You probably have another application (in systray) that uses Ctrl+Space for something else. In my case I have a small utility which when I press Ctrl+Space makes the active window on top.
The solution for you would be to (1) exit that application which overrides the keys or (2) in Eclipse change Ctrl+Space to some other set of keys.
This was solution for me to get rid of windows key shortcuts:
Go to Start > Type in regedit and start it
Navigate to HKEY_CURRENT_USER/Control Panel/Input Method/Hot Keys
Select the key named: 00000070 for the Chinese (Traditional) IME -
Ime/NonIme Toggle hotkey 00000010 for the Chinese (Simplified) IME -
Ime/NonIme Toggle hotkey
In the right sub-window, there are three subkeys. Key Modifiers
designate Alt/Ctrl/Shift/etc and is set to Ctrl (02c00000). Virtual
Key designates the finishing key and is set to Space (20000000).
Change the first byte in Key Modifiers from 02 to 00
Change the first byte in Virtual Key from 20 to FF
Log off and log back on. I don't think it's necessary to restart.
Do not change the Hot keys for input languages in Control Panel,
unless you want to do this all over again.
https://superuser.com/questions/327479/ctrl-space-always-toggles-chinese-ime-windows-7
I have seen a similar problem in Eclipse Juno (version 4.2.0).
Since you have already tried Eclipse/Java code completion not working, I would check to see if there are any key conflicts. Go to Window -> Preference -> General -> Keys. In the filter box, replace the light gray "type filter text" with the word "Content"; the first item should be "Content Assist." Select it. It should have nothing in the Conflicts box in the lower right-hand portion of the screen.
If you have no conflicts, then it is likely that there is another program, outside of Eclipse, that is binding to Ctrl + Space.
I worked around this with an ugly solution. I copied the Content Assist. In the Binding field, I entered held down the Ctrl + Alt keys and pressed space. This restored the Content Assist function, but it required a brain remap when I am using one machine.
!Screenshot of Eclipse Juno, I had the same problem, then I changed it to different key combination, then it works.1
This is what solved my problem.
Goto Control Panel -> Clock, Language and Region -> Change keyboards or other input methods -> Change keyboards... -> Advanced Key Settings. For some reason I had ctrl + space set as Key sequence for language hot keys. I changed them to something else and rebooted.
Make sure to reboot because it did not work for me without the reboot.
On my Ubuntu, Xfce, ctrl space was allocated to switch language on the iBus preferences (if you have this running, you will see the 'i' icon on the task bar, right click and choose preferences). To change this, bring up the IBus Preferences, on the General tab, see the "Enable or disable:" option, click the ellipses and provide a different keyboard assignment.
This sorted me out without need to restart Eclipse.
I use eclipse indigo and had this problem. Creating a new workspace did not worked.
Go to Windows->preference->General->Keys->"Restore Default" - This fixed my issue
Note that I just had English(US) on windows 7 [Control Panel-> Clock,Language and Region ->Change keyboard or other input methods-> Keyboards and Languages->change Keyboards...->General ==>Default language is English and Installed Services I just had English(US) alone
After doing this some you might need to restart the system if it does not fix.
This is how I fixed my problem on Ubuntu 12.04 regardless of the eclipse version. My problem was that the ibus was overriding the shortcut so I deleted this shortcut configuration.
Type ibus in the dash:
Then select Keyboard Input Methods. From there click on the first three dots next to the Enable or disable textfield. This windows should appear:
If there is something bound to Ctrl + Space simply delete it.
#Polac - Thx. That's what fixed it for me. I'd hit ctrl+space and I'd get a popup for chinese character selection. I have Windows 7 so for me it was:
Control Panel -> Region and Language -> Keyboards and Languages tab -> Change keyboards... button -> Advanced Key Settings tab
Be warned, its stubborn. I tried to just clear them, but as soon as I applied the settings they reset back to using the original key bindings. If I change the key binding to something obscure they still reset sometimes. It's annoying. Maybe its just my OS installation that's goofed, but it could be a Microsoft bug.
Didn't need Chinese on my system, so I removed it as an installed language in the first tab and that finally got rid of the hardcoded Chinese key bindings.
In Eclipse you can use the Alt-/ character sequense instead of Control-Space. This is an old problem which Eclipse and Chinese keyboards, which they addressed by adding this short cut.
I found the answer.
Windows / UV Elements - was OFF! I don't know how but they were off. And when you click Ctrl+Space he working, but your all elements are off and you think that it is not working. You must on all UV elements and after your Ctrl + Space will be work.