How to disable the Win key if it's the only key being pressed using AutoHotkey? - windows

I often find myself tapping the Win key by mistake, how to disable it when it's the only key being pressed using AutoHotkey?
In other words, tapping Win shouldn't bring up the start menu, but the Win key combination shortcuts should still work, e.g. pressing Win+X should open the quick link menu.

Quote from #MenuMaskKey:
The Start Menu (or the active window's menu bar) can be suppressed by sending any keystroke. The following example disables the ability for the left Win to activate the Start Menu, while still allowing its use as a modifier:
~LWin::Send {Blind}{vkE8}
Quote from Blind mode:
The Blind mode can be enabled with {Blind}, which gives the script more control by disabling several things that are normally done automatically to make things work as expected.
~LWin::Send {vkE8} may not work in some cases without {Blind}.

Related

overriding system-wide (Windows) key shortcuts in Qt app

Ctrl+Escape is a global Windows shortcut for opening main system menu. But I would like my Qt application to use this shortcut without triggering Windows main menu. I know it is probably a bad idea to override system shortcuts in general, but I would like to use this shortcut is a very limited use case.
This usecase is as follows. I have a popup window containing several rows or items. This window is opened by Ctrl+Tab and while the user holds Ctrl and keep pressing Tab, the current rows are cycled through. When the user releases Ctrl, the current row is used for some operation... But sometimes it happens that user presses Ctrl+Tab and then realizes he does not want to continue. He usually presses Escape while still holding Ctrl. And then it triggers Windows system menu and normal user gets confused, choleric user get angry... which is a bad thing. In other words I would like to be able to close the popup window when user presses Ctrl+Escape. How to do that? It is even possible?
If I write the code using this shortcut like any other short, it does not work and it always triggers Windows main menu.
As I understand it, Qt will typically not receive the key event if the underlying window system has intercepted it. For example even QtCreator cannot override system-wide shortcuts.
This question is almost a duplicate of: C++/Qt Global Hotkeys
While that question is asking specifically to capture shortcuts in a hidden/background application, I think the basic concept is the same -- capture shortcuts before the window system processes them.
From that answer, UGlobalHotkey seems pretty good, and the How to use System-Wide Hotkeys in your Qt application blog post could be useful for your limited-use case (but read the comments on that blog post about fixing the example).
Also found:
https://github.com/mitei/qglobalshortcut
https://github.com/Skycoder42/QHotkey (looks like a more detailed version of above)

Shortcut for cursor actions

I have windows 7 and here is my problem, I have an sequence of actions that I should make once every 3 minutes, it's right click on mcafee icon, and click on a parameter, that's all, I would like to create a keybord shortcut of that, I know that I didn't explain a lot, but I'm open to any questions you would have.
I assume that with "mcafee icon" you mean its tray icon.
If so, you can't do it with a single shortcut (unless that parameter you want to click on has one), but you can do it with either:
A sequence of shortcuts:
Windows key (or Ctrl+Esc)
Esc
Shift+Tab
Shift+Tab
You will now have set the focus on either the leftmost tray icon or the arrow to display the hidden tray icons (the focused item will have a rectangle around it), and you'll be able to move the focus to the other tray icons with the right or left keys. So...
Press the right or left keys until you focus the mcafee icon
Press the "menu key" or, if your keyboard doesn't have it, Shift+F10
You'll now have opened the mcafee's tray icon context menu, where if I understood you your "parameter" is. All you have left to do is to:
Select the "parameter" entry with the up or down keys
Press Return
Or you can probably do it with some kind of macro recording, UI automated testing or "gui scripting" (e.g. AutoHotKey) software . I don't know well any though so I can't advice you on that.
Beware that if you adopt the first solution the sequence of shortcuts solution will vary over time, you can't for example put it in a script and rely that it will always work, because the tray icons generally get placed in different orders and if you have the auto-hide feature enabled every now and then some get hidden.
The automated solution might be more stable instead, if the icons can be reliably identified.
I should also warn you that I wasn't able to really test the shortcuts' sequence on Windows 7 before posting, I have at my disposal at this moment just a Vista, but I'm rather confident it is valid for 7 too.

Mac OS keyboard shortcut to toggle two menu items

I am working on a dedicated keyboard shortcut controller for a specific app, Avid's Pro Tools. There is a default keyboard shortcut that toggles the view of two windows, "Mix" and "Edit."
Both of these commands have entries on the Window menu in the app. However, there is a little check next to the window that is active, and a little diamond next to the window that isn't. So these switch as the window is toggled (by the single keyboard shortcut).
I'm looking for a way to program a different key using the Mac OS System Application shortcuts. When I assign a new keyboard shortcut to the "Mix" and "Edit" menu items, I don't get the toggle behavior, it just causes the first item in the menu to be active. This makes sense, as it is getting two commands at once. To get the behavior I want now I have to use two keyboard shortcuts, which breaks a UI convention in Pro Tools. Any suggestions appreciated!

How can I disable / permanently hide the taskbar in Windows 7?

I would like to completely remove the Windows 7 taskbar, including tray and start-button, so that the user can not reactivate it by pressing the Windows-key on the keyboard. however, all other explorer functionality (i.e. starting an explorer Window using Windows+E) should remain.
Is it possible to permanently hide the complete taskbar? Maybe there are some registry values on could change in order to make that behaviour selectable using a powershell script?
Thanks a lot
Here be my solution (it hides rather than replaces or removes the native taskbar - this allows it to work with programs that have a dependency on the native taskbar, such as display fusions taskbar).
disable-taskbar-always-top
Still to solve: [HALF SOLVED]
Eliminate the stupid line that auto-hide leaves with some maximized applications, such as Google Chrome
HALF SOLUTION -
If you move the taskbar to the left or right edge prior to doing the above steps, you don't get the stupid auto-hide line at the top or bottom of Google Chrome. Since the native taskbar is not mouse sensitive anymore, it won't impact your use of hot corners, or multi monitors (for instance I have the native taskbar on the left of my middle monitor, and it does not popup when moving between monitors using the steps in this post).
Okay, I think I have finally - finally - got a workaround that:
Keeps the native Windows 7/8 taskbar hidden for your session (you do have a couple of steps you need to do on start-up each time, or if you manually un-hide the taskbar).
Prevents the native Windows 7/8 taskbar from opening with popups or programs seeking attention (flashing taskbar thing).
Prevents the native taskbar from being mouse sensitive (i.e. despite auto-hide, it will not appear when you mouse over the hidden taskbar anymore).
Allows you to use the screen area that is occupied by the native taskbar (this is the problem of not combining Taskbar-Hide with the autohide setting; you can't use that screen real-estate).
Allows you to run alternative taskbars that are dependent on keeping the native taskbar functional (for instance Dislay Fusions Multi-Monitor Taskbar + [Settings >> Advanced Settings ?> 'Show On All Montiors'])
One Time Steps:
1) Download and run this registry edit to prevent balloon notification popups from the native taskbar/system tray:
Notifications - Enable or Disable Message Balloons - Windows 7 Help Forums
(You can open this in notepad to see what changes it will make prior to installing it, if you want).
2) Download and run Taskbar-Hide from here:
Hide Taskbar: Hide Taskbar in Windows 8 | 7 with a hotkey
3) Set the taskbar to auto-hide
Optional:
3) B) Add a shortcut to Taskbar-Hide.exe in your startup folder, to have it launch automatically with windows on startup (you still need to use the Ctrl+Esc hotkeys to activate the functions of taskbar-hide - though you could also script this if you were really keen).
Startup Folder:
C:\Users{User Name}\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
Steps to hide taskbar after each start-up or manually un-hiding using Taskbar-Hide
4) Make sure Taskbar-Hide is running.
5) Make sure the taskbar is in its auto-hide state (i.e. you'll have to look at any programs that are currently seeking attention).
6) Once the taskbar is 'auto-hidden', press the hotkeys for Taskbar-Hide (Ctrl+Esc)
[This should mean that the native taskbar area is no longer sensitive to mouse activity]
One way is to replace the explorer shell with your own shell. This is the a common method done in Windows 7 Embedded.
In older versions of Windows (such as XP) it was possible to specifiy a shell for each user via regedit. I am not sure this is easily possible in Windows 7.
See https://superuser.com/questions/352865/how-do-i-change-the-windows-shell-for-only-one-user
Make an empty exe file and use it as the file to use in your "Custom User Interface" group policy. Additional information here.
I have found another solution that works nearly perfect for me, by just hiding the Taskbar and the Start button by simply sending both the WM_HIDE message:
Handle = FindWindow("Shell_TrayWnd", "");
...
ShowWindow(Handle, SW_SHOW);
The only problem I have with that solution is that the taskbar is not hidden permanently, i.e. as soon as one element is activated that does not have the focus, which on the taskbar leads to the item flashing in yellow, the taskbar gets visible again.
I'm not sure if there is a way to prevent Windows from re-enabling the visible flag of the taskbar in some way, or a method to hook to the SW_SHOW in C# though.

Programmatically disable Keyboard & Mouse

Is there a way to disable keyboard & mouse?
Ideally I'm looking for a solution whereby I could completely disable mouse and almost disable the keyboard - bar one key combination, for example Ctrl+A. So, once Ctrl+A is pressed - the PC will go to a mute stage (no mouse/keyboard) until Ctrl+A is pressed again.
have a look at "BlockInput Function"
refer MSDN

Resources