Add a --debug-keyboard command line option
It's a little more discoverable than the env var.
This commit is contained in:
parent
5cd9af6c37
commit
f857b1afd3
2 changed files with 11 additions and 2 deletions
|
|
@ -129,6 +129,11 @@
|
|||
instead of ignoring them. Useful when debugging rendering problems
|
||||
|
||||
|
||||
--debug-keyboard
|
||||
type=bool-set
|
||||
This option will cause kitty to print out what key events as they are received
|
||||
|
||||
|
||||
--debug-font-fallback
|
||||
type=bool-set
|
||||
Print out information about the selection of fallback fonts for characters not present in the main font.
|
||||
|
|
|
|||
|
|
@ -31,10 +31,14 @@ def load_all_shaders(semi_transparent=0):
|
|||
load_borders_program()
|
||||
|
||||
|
||||
def init_graphics():
|
||||
def init_graphics(debug_keyboard=False):
|
||||
glfw_module = 'cocoa' if is_macos else ('wayland' if is_wayland else 'x11')
|
||||
if debug_keyboard:
|
||||
os.environ['GLFW_DEBUG_KEYBOARD'] = '1'
|
||||
if not glfw_init(glfw_path(glfw_module)):
|
||||
raise SystemExit('GLFW initialization failed')
|
||||
if debug_keyboard:
|
||||
os.environ.pop('GLFW_DEBUG_KEYBOARD')
|
||||
return glfw_module
|
||||
|
||||
|
||||
|
|
@ -184,7 +188,7 @@ def _main():
|
|||
opts = create_opts(args)
|
||||
if opts.editor != '.':
|
||||
os.environ['EDITOR'] = opts.editor
|
||||
init_graphics()
|
||||
init_graphics(args.debug_keyboard)
|
||||
try:
|
||||
with setup_profiling(args):
|
||||
# Avoid needing to launch threads to reap zombies
|
||||
|
|
|
|||
Loading…
Reference in a new issue