Skip to content

Commit d338764

Browse files
relaxboxtakase1121
andauthored
Added docs for X11 key remapping (#33)
* Added docs for X11 key remapping Lite-XL does not seem to be aware of any keyboard re-mapping done via the usual tools (such as `xkbset` or the GNOME setting). I assume this is because Lite is built on SDL, which is getting its keyboard input via some mechanism that is bypassing the usual X11 drudgery? Anywhoo, as a lifelong Caps -> Ctrl remapping this is kind of a big deal. Fortunately there's a pretty straightforward workaround. This is a big enough deal that I think it'll cause a lot of people to bounce off Lite-XL pretty quickly. I'm not sure this is the best place in the docs but I think it's worth documenting *somewhere*. Happy to move locations or wording as suggested. * Various PR feedback * Moved everything inside a "tip" admonition * Used the proper name "Lite XL" * Suggest remapping via the Lite XL config * Fix typo * Rephrase a little bit --------- Co-authored-by: takase1121 <20792268+takase1121@users.noreply.github.com>
1 parent 9cd7516 commit d338764

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/user-guide/configuration.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,22 @@ To remove an existing keyboard shortcut, you can use `keymap.unbind()`.
236236
Afterwards, press the "Save" button to save the changes.
237237
![Screenshot showing the keybind changer][13]{ loading=lazy }
238238

239+
240+
!!! tip
241+
On X11, Lite XL interprets keypresses based on their physical location,
242+
regardless of the keyboard layout set in your DE settings.
243+
Tools such as `xmodmap` will therefore have no effect; instead you'll have to modify your keymap
244+
in Lite XL directly.
245+
246+
For example, to remap ++caps-lock++ to ++ctrl++, add this to your user module:
247+
248+
```lua
249+
local modkeys = require("core.modkeys-" .. (PLATFORM == "Mac OS X" and "macos" or "generic"))
250+
modkeys.map["capslock"] = "ctrl" -- this maps capslock to ctrl
251+
table.insert(modkeys.keys, "capslock") -- this enables capslock as modifier
252+
modkeys.map["left ctrl"] = "capslock" -- this maps left ctrl to capslock
253+
```
254+
239255
## Themes
240256

241257
The default theme is a dark theme.

0 commit comments

Comments
 (0)