mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 17:48:19 +00:00
Automatically release the mouse for x11, when breakpoint is hit
This commit is contained in:
parent
6b6ee21338
commit
87743bd412
|
@ -10,5 +10,8 @@ Optional:
|
|||
- mold (linker), needs to be in PATH
|
||||
- ninja
|
||||
|
||||
Linux (x11):
|
||||
- xdotool, for automatic mouse release
|
||||
|
||||
Inside vscode press `Ctrl+Shift+P` and type `Scan for kits`, press enter.
|
||||
Now press press `Ctrl+Shift+P` and type `Select a kit`, choose one with `[DDNet]` as prefix for best defaults.
|
||||
|
|
|
@ -79,6 +79,7 @@
|
|||
// https://aur.archlinux.org/packages/clang-format-static-bin
|
||||
"clang-format.executable": "clang-format-10",
|
||||
"lldb.launch.expressions": "native",
|
||||
"lldb.launch.initCommands": ["target stop-hook add --one-liner \"command script import ${workspaceFolder}/other/vscode/lldbinit.py\""],
|
||||
"editor.defaultFormatter": "xaver.clang-format",
|
||||
"[rust]": {
|
||||
"editor.defaultFormatter": "rust-lang.rust-analyzer",
|
||||
|
|
15
other/vscode/lldbinit.py
Normal file
15
other/vscode/lldbinit.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/python
|
||||
import os
|
||||
import shutil
|
||||
|
||||
# make sure to have the x11 package xdotool installed on your system
|
||||
def check_global_executable_exists(executable_name):
|
||||
return shutil.which(executable_name) is not None
|
||||
|
||||
def is_x11_session():
|
||||
return "DISPLAY" in os.environ and "WAYLAND_DISPLAY" not in os.environ
|
||||
|
||||
if is_x11_session() and check_global_executable_exists("xdotool"):
|
||||
print("Breakpoint hit, releasing mouse!")
|
||||
os.system("setxkbmap -option grab:break_actions")
|
||||
os.system("xdotool key XF86Ungrab")
|
Loading…
Reference in a new issue