Jump to content

Can't find a way to HotKeySet Win key + Q (#q does not work) - (Moved)


Recommended Posts

Hi everyone! Just and easy one I guess, is there a way to set Win Key Q shortcut as an HotKeySet?

I have been trying a bit of everything without results.. "q{LWin}"  "q & {LWin}"  ("{LWin}" & "q", "#q"  ecc..

 

 

Link to post
Share on other sites
  • Developers

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites

hey  thanks a lot for your replies!

 

Is simply aiming to close or minimize active window 

would be amazing to replace the alt+q alt+w with something like win left {LWIN}  key or anything that activates combo win+q  win+w

```

HotKeySet("!w" , "Minimize")
HotKeySet("!q", "Kill")


While 1
    Sleep(100)
WEnd

Func Minimize()
    WinSetState ("[ACTIVE]", "", @SW_MINIMIZE)
 EndFunc


While 1
    Sleep(100)
WEnd

Func Kill()
    WinClose ( "[ACTIVE]", "" )
 EndFunc

```

Link to post
Share on other sites

WIN+w --> reserved by Windows for Whiteboard
WIN+q --> reserved by Windows for Query
WIN+s --> reserved by Windows for Search

convince yourself with this script:

_HotKey("{ESC}")
_HotKey("#w")   ; is reserved by Windows --> Whiteboard
_HotKey("#q")   ; is reserved by Windows --> Query
_HotKey("#s")   ; is reserved by Windows --> Search
Func _HotKey($hotkey = "")
;       ! ALT  + SHIFT  ^ CONTROL  # WinKey
    Switch @HotKeyPressed
        Case "{ESC}"
            Exit 0*MsgBox(0, Default, "Exit", 3)
        Case "#w"
            Beep() ; will never beep
        Case "#q"
            Beep() ; will never beep
        Case "#s"
            Beep() ; will never beep
        Case Else
            If Not IsDeclared("hotkey") Then Return MsgBox(16 + 262144, Default, "No CASE statement defined for hotkey " & @HotKeyPressed,15)
            If HotKeySet($hotkey, "_Hotkey") = 0 Then Return MsgBox(16 + 262144, Default, "Hotkey " & $hotkey & " invalid or set by another application.",15)
    EndSwitch
EndFunc   ;==>_HotKey

While Sleep(100)
    MsgBox(262144, Default, "Press ESC to Exit." & @CRLF & @CRLF & "or WIN+w / WIN+q / WIN+s  to verify the WIN Keys." ,3)
WEnd

 

 

App: Au3toCmd              UDF: _SingleScript()                             

Link to post
Share on other sites

Hey  thanks for your reply! just tried your script & you are totally right aswell, I sort of found a manual work around with this two articles:

 

this works for Win+q (not with Win+w): https://winaero.com/disable-certain-winkey-shortcuts-in-windows-10/ 

this works disabling with windows whiteboard (Win+w) but still can not assign it https://www.windowscentral.com/how-disable-windows-ink-workspace-windows-10

-

temp solution was assigning minimize to win+y and with WindowsPowerToys with admin right assign key remap Win+y to Win+w. this managed to work

 

it is a bit wonky but seems to work! If someone has any other idea on how to mute/disable win+w windows ink workspace and assign hotkey in a clean way super happy to do so

 

Link to post
Share on other sites
  • 3 weeks later...

@Palkiao

here is trick it's disable Win+R;

Disable Win+R:

#include <Misc.au3>
HotKeySet("{ESC}", "_exit")
Global $dll = DllOpen("user32.dll")
Global $iPID
While 1
    If _IsPressed("5B", $dll) And _IsPressed("52", $dll) Then ;if Left Win Key[5B] Pressed And R Key[52] Pressed then
        _DeleteTab("Run")
        WinSetState("Run", "", @SW_MINIMIZE)
        WinSetState("Run", "", @SW_DISABLE)
    EndIf
WEnd
Func _DeleteTab($handle) ;;DeleteTab
    Local Const $sCLSID_TaskbarList = "{56FDF344-FD6D-11D0-958A-006097C9A090}"
    Local Const $sIID_ITaskbarList = "{56FDF342-FD6D-11D0-958A-006097C9A090}"
    Local Const $sTagITaskbarList = "HrInit hresult(); AddTab hresult(hwnd); DeleteTab hresult(hwnd); ActivateTab hresult(hwnd); SetActiveAlt hresult(hwnd);"
    Local $oTaskbarList = ObjCreateInterface($sCLSID_TaskbarList, $sIID_ITaskbarList, $sTagITaskbarList)
    Local $hWinhandle = WinGetHandle($handle)
    $iPID = WinGetHandle($handle)
    $oTaskbarList.DeleteTab($hWinhandle)
EndFunc   ;==>_DeleteTab
Func _exit()
    WinClose($iPID)
    Exit
EndFunc   ;==>_exit

 

Edited by ad777

iam ِAutoit programmer.

best thing in life is to use your Brain to

Achieve

everything you want.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...