Coder Social home page Coder Social logo

rdphotkeyhelper's Introduction

rdphotkeyhelper's People

Contributors

neon-dev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

rdphotkeyhelper's Issues

Port to v2

Hi! I'm just starting to use ahk and realized that a bunch of the codes (like this one) are in v1. I can try porting this one to v2, but do you have any guidelines that I could follow?

Thank you!

Doesn't work for me

Hi, looks like a great script!
Unfortunately, for me it doesn't work at all. Server and client are both Windows 10 21H2. Tried script and exe release.
Any ideas what could be the problem?

Combine with numpad keys mapping

Hi,

First of all thanks for the script!
I also use another script to map the numpad keys to volume keys and prev/next:

#Requires AutoHotkey v1.1.33
#usehook

;if not A_IsAdmin
;{
;   Run *RunAs "%A_ScriptFullPath%"  ; Requires v1.0.92.01+
;   ExitApp
;}

NumpadUp::Volume_Up
NumpadDown::Volume_Down
NumpadIns::Volume_Mute

NumpadLeft::Media_Prev
NumpadClear::Media_Play_Pause
NumpadRight::Media_Next

I also adjusted your script to be able to use these keys in a RDP session:

;@Ahk2Exe-Set FileVersion, 1.2.0.0
;@Ahk2Exe-Set ProductVersion, 1.2.0.0
;@Ahk2Exe-PostExec "MPRESS.exe" "%A_WorkFileName%" -q -x, 0,, 1, 1

#SingleInstance Force
KeyHistory(0)
A_IconTip := "RDP Hotkey Helper"
ExeNamesPattern := "i)\\(mstsc|ApplicationFrameHost|VMConnect)\.exe$"
SetTitleMatchMode("RegEx")
While true {
  global RdpHwnd := 0
  WinWaitActive("ahk_exe " ExeNamesPattern)
  RdpHwnd := WinExist("A")
  Suspend(true) ; rebind all hotkeys, otherwise they won't work in RDP fullscreen mode
  Suspend(false)
  Sleep(250)
  WinWaitNotActive("ahk_id " RdpHwnd)
}

#UseHook
Volume_Mute::PassToLocalMachine()
Volume_Down::PassToLocalMachine()
Volume_Up::PassToLocalMachine()
Media_Next::PassToLocalMachine()
Media_Prev::PassToLocalMachine()
Media_Stop::PassToLocalMachine()
Media_Play_Pause::PassToLocalMachine()

NumpadUp::PassToLocalMachine()
NumpadDown::PassToLocalMachine()
NumpadIns::PassToLocalMachine()

NumpadLeft::PassToLocalMachine()
NumpadClear::PassToLocalMachine()
NumpadRight::PassToLocalMachine()

PassToLocalMachine() {
  If (RdpHwnd == 0 || WinExist("A") != RdpHwnd) {
    Send("{" A_ThisHotKey "}")
    Return
  }
  WM_APPCOMMAND := 0x0319
  ;MsgBox A_ThisHotKey
  If (A_ThisHotKey = "Volume_Mute" or A_ThisHotKey = "NumpadIns")
    PostMessage(WM_APPCOMMAND, 0, 8<<16, , "ahk_class Shell_TrayWnd") ; APPCOMMAND_VOLUME_MUTE
  Else If (A_ThisHotKey = "Volume_Down" or A_ThisHotKey = "NumpadDown")
    PostMessage(WM_APPCOMMAND, 0, 9<<16, , "ahk_class Shell_TrayWnd") ; APPCOMMAND_VOLUME_DOWN
  Else If (A_ThisHotKey = "Volume_Up" or A_ThisHotKey = "NumpadUp")
    PostMessage(WM_APPCOMMAND, 0, 10<<16, , "ahk_class Shell_TrayWnd") ; APPCOMMAND_VOLUME_UP
  Else If (A_ThisHotKey = "Media_Next" or A_ThisHotKey = "NumpadRight")
    PostMessage(WM_APPCOMMAND, 0, 11<<16, , "ahk_class Shell_TrayWnd") ; APPCOMMAND_MEDIA_NEXTTRACK
  Else If (A_ThisHotKey = "Media_Prev" or A_ThisHotKey = "NumpadLeft")
    PostMessage(WM_APPCOMMAND, 0, 12<<16, , "ahk_class Shell_TrayWnd") ; APPCOMMAND_MEDIA_PREVIOUSTRACK
  Else If (A_ThisHotKey = "Media_Stop")
    PostMessage(WM_APPCOMMAND, 0, 13<<16, , "ahk_class Shell_TrayWnd") ; APPCOMMAND_MEDIA_STOP
  Else If (A_ThisHotKey = "Media_Play_Pause" or A_ThisHotKey = "NumpadClear")
    PostMessage(WM_APPCOMMAND, 0, 14<<16, , "ahk_class Shell_TrayWnd") ; APPCOMMAND_MEDIA_PLAY_PAUSE
}

Exit(*) {
  ExitApp()
}

It seems the two scripts conflict with eachother. When I had the RDP session in fullscreen and switch back to my native desktop, the numpad keys don't map anymore.

Do you have any idea how I could combine these functionalities?

Many AV programs flag the compiled release version as a virus/trojan

Hey, thanks for creating this little tool, it's really helpful in homeoffice setups.

Only issue is, the compiled exe you released gets flagged by a lot of AV programs. Noticed it first a few days ago when a device running G Data AV blocked it, and today my other computer running windows defender also quarantined it.

Since a version I compiled myself from your AHK script works fine without any alerts I'd guess it's because you activated compression during compilation. Those packers are quite frequently (also) used by malware, so quite a lot of AV engines react to them.

Switching between local computer and RDP switches NumLock on

I always have my NumLock off, but when running RDPHotkeyHelper in the background and switching from my local computer to my RDP computer the NumLock turns on. I can turn it off again, but when I switch back to local and then back to RDP it automatically switches on again.

Steps to reproduce (Windows 10 Pro):

  • Local (computer): switch numlock off
  • Switch from local to RDP window (I have it fullscreen): the Numlock automatically switches on
  • RDP: switch numlock off
  • Switch from RDP to local: numlock stays off
  • Switch back from local to RDP: numlcok switches on again

When I stop RDPHotkeyHelper and do the steps again, the numlock stays off the whole time.

Edit:
Ahhh I see you do it deliberately:
SetNumLockState, On ; the remote desktop client disables num lock upon first connection for some reason
So I guess it should be optional.
Have an extra menu item 'NumLock: State', and have the user select the option to turn it off (default take the current state of the NumLock when RDPHotkeyHelper was started).

Hyper-V support

Would be good to add support for virtual machine connections via Hyper-V as well.

Should be relatively simple -- as best as I can tell the windows just end with the title " - Virtual Machine Connection"

Alternately, you could match based on executable: vmconnect.exe

Media keys not working

Hi,

Thanks for your script! Volume keys are working nicely... :-)

However, somehow I can't seem to get the media keys to work. My RDP client is a Win10 machine.

Media keys work locally.

Any ideas what might go wrong?

Thanks for your help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.