Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modmap: Where to put it; cancelling built-in mods (#655) #666

Merged
merged 6 commits into from
Jun 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions doc/Custom-layouts.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,30 @@ If the string defining a tap or a swipe is anything other than one of the built-
The string can output multiple characters, but cannot combine the built-in strings to specify a sequence of keystrokes.

## Modmap
The `<modmap>`...`</modmap>` pair encloses custom mappings for modifier keys.
The `<modmap>`...`</modmap>` pair encloses custom mappings for modifier keys. The modmap is placed inside the `<keyboard>`...`</keyboard>` pair, but outside any row.

A modmap can contain the following tags, each of which must have an `a` and a `b` property:
* `<shift a="`...`" b="`...`" />` —This says that, if the Shift modifier is on (or the user made a clockwise gesture on a key), and if the key would normally generate the value after "a", it must instead generate the value after "b".
* `<fn a="`...`" b="`...`" />` —This says that, if the Fn modifier is on (or the user made a round-trip gesture on a key), and if the key would normally generate the value after "a", it must instead generate the value after "b".

The "a" and "b" values are as specified above in _Possible key values_. A `<fn`...`/>` tag modifies a gesture only if no `<shift`...`/>` tag did.
The "a" and "b" values are as specified above in **Possible key values**. A `<fn`...`/>` tag modifies a gesture only if no `<shift`...`/>` tag did.

There can be as many of these tags inside `<modmap>` as needed.

### Example
### Examples
Turkish keyboards use the Latin alphabet, but when "i" is shifted, it should produce "İ". This is achieved with the following modmap:


<modmap>
<shift a="i" b="İ" />
</modmap>

On built-in layouts for European locales, `Fn`+`e` produces the € character. This can be inhibited with the following modmap, which maps the modified `e` key to itself:
Spike-from-NH marked this conversation as resolved.
Show resolved Hide resolved

<modmap>
<fn a="e" b="e" />
</modmap>

These two examples are each shown in a modmap, for completeness. Typically, however, you would have a single modmap containing all the desired `<shift>` and `<fn>` tags.

## Portrait vs. landscape
Unexpected Keyboard remembers *separately* which layout has last been used in portrait and landscape orientation. That is to say, you may have one custom layout for portrait orientation, but another custom layout for landscape orientation, and Unexpected Keyboard will switch between them without your intervention.
Expand Down
Loading