-1

By default, the action of the context menu key in VS Code editor is opening the context menu. I want to change its function to run a script or execute a program for example, I tried to do that from keyboard shortcuts settings, but I didn't.

Although I set the shortcut key (context menu) for the function that I want to perform (run a script or execute a program in terminal ...), but the context menu key function still works (when I click on the context menu key, the context menu stills appear) this is a picture

enter image description here

  • (I want to disable the context menu from appear) - is that possible to do (Knowing that this can be done in PyCharm ...):

[![enter image description here][2]][2]

  • Anybody can help? I'll appreciate it, Thanks.
yfjuu 6
  • 33
  • 5
  • Did the answer help? I see you keep asking a bunch of AHK questions without resolving this one. – Destroy666 Apr 30 '23 at 13:30
  • No, I can't change the change the action of Context Menu key in VS Code, but I found another solution. – yfjuu 6 Apr 30 '23 at 13:44
  • So post the solution, please. Mine should definitely work too, but if you found something yourself and expect help from people here, you should also help other people. – Destroy666 Apr 30 '23 at 13:45
  • #If WinActive("2kha.ahk") AppsKey:: send ^{SC029} CoordMode, ToolTip, Screen ToolTip 2kha,1555,1400 Sleep, 1000 Run, "%A_ScriptFullPath%" ;Reload Return – yfjuu 6 Apr 30 '23 at 13:48
  • No, I meant as an answer. Like mine below. With some explantation as to why this is the solution. – Destroy666 Apr 30 '23 at 14:37

1 Answers1

0

This looks to be impossible within VSCode indeed, as suggested by old issues like this and lack of visible binding in shortcut listing.

As a workaround, you can use AutoHotKey and rebind the AppsKey (ContextMenu) key to an unused combination just when VSCode window is active, then use that combination for your program/script binding.

Example of script.ahk:

#IfWinActive ahk_exe Code.exe
AppsKey::Send {Shift Down}{Ctrl Down}{Alt Down}6{Alt up}{Ctrl Up}{Shift Up}

Would bind it to Shift + Ctrl + Alt + 6

Destroy666
  • 6,771