keyboard_modifiers

On this page
  1. window:keyboard_modifiers()

window:keyboard_modifiers()#

Returns two values; the keyboard modifiers and the key status leds.

Both values are exposed to lua as strings with |-delimited values representing the various modifier keys and keyboard led states:

  • Modifiers - is the same form as keyboard assignment modifiers
  • Leds - possible flags are "CAPS_LOCK" and "NUM_LOCK". Note that macOS doesn't have a num lock concept.

This example shows the current modifier and led status in the right status area:

local wakterm = require 'wakterm'

local config = wakterm.config_builder()

config.debug_key_events = true

wakterm.on('update-status', function(window, pane)
  local mods, leds = window:keyboard_modifiers()
  window:set_right_status('mods=' .. mods .. ' leds=' .. leds)
end)

return config
Edit this page