Skip to content

Commit

Permalink
Release v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
timokroeger committed Jul 3, 2024
1 parent 5962f30 commit ab62562
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 25 deletions.
23 changes: 22 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## [2.0.0] - 2024-07-03

### Breaking Configuration Changes

- The `base_layer` must be specified in the configuration (it is not inferred automatically anymore).
- Split `layer_lock` target into separate `layer` and `lock` targets.
- Locked layers no longer automatically have temporary modifiers to revert their activation.
Temporary modifiers can be specified with the `layer` target like normal modifiers.

### Code changes

- Improvements to the tray icon code: Message loop and window creation handled by the `winmsg-executor` crate.
- Use stabilized language and library features: C-String literals and TLS functions
- Better handling and documentation around re-entrancy of the low level keyboard hook
- Refactor layout handling:
* Remove manual bit packed keymapping representation
* Prepare for layouts to be serialized
* Clear interface between immutable layout and virtual keyboard using the layout
* Remove all graph algorithms and dependency on `petgraph`

## [1.6.0] - 2023-07-19

- Allow configurations with only one layer
Expand Down Expand Up @@ -89,7 +109,8 @@
Initial Release


[Unreleased]: https://github.com/timokroeger/kbremap/compare/v1.6.0..HEAD
[Unreleased]: https://github.com/timokroeger/kbremap/compare/v2.0.0..HEAD
[2.0.0]: https://github.com/timokroeger/kbremap/compare/v1.6.0..v2.0.0
[1.6.0]: https://github.com/timokroeger/kbremap/compare/v1.5.1..v1.6.0
[1.5.1]: https://github.com/timokroeger/kbremap/compare/v1.5.0..v1.5.1
[1.5.0]: https://github.com/timokroeger/kbremap/compare/v1.4.2..v1.5.0
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "kbremap"
description = "Custom keyboard layouts for windows"
version = "1.6.0"
version = "2.0.0"
authors = ["Timo Kröger <timokroeger93@gmail.com>"]
edition = "2021"
license = "MIT/Apache-2.0"
Expand Down
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
# `kbremap`

Custom keyboard layouts for windows.
Custom keyboard layouts for Windows.

`config.toml` is a well commented example config for the Dvorak layout.
`config.toml` is a well-commented example configuration for the Dvorak layout.

## Features
* Remap any key to any other key
* Supports Unicode characters, including most Emojis ⌨️🔥
* Virtual layers support (e.g. right alt to overlay arrow keys for navigation)
* Virtual layers (e.g., right alt to overlay arrow keys for navigation)
* No installation or administrator rights required
* Double-click on tray icon disables the layout
* Option to run at system startup
* Uses the windows low-level keyboard hook for maximum compatibility
* Option to run at Windows system startup
* Uses the Windows low-level keyboard hook for maximum compatibility

## Features `neo.toml` configuration
* Supports all 6 layers of the [Neo-Layout](https://neo-layout.org/)
* Support for dead keys on L1 and L2 (PR for L3-L6 welcome)
* Optional QWERTY/QWERTZ layout for shortcuts with CTRL, ALT and WIN modifiers
* Support for dead keys on Layers 1 and 2 (Pull Requests for Layers 3-6 are welcome)
* Optional QWERTY/QWERTZ layout for shortcuts with CTRL, ALT, and WIN modifiers

## Known issues
* Not working for RDP in full screen mode (or when "Apply Windows key combinations:
* Does not work for RDP in full-screen mode (or when "Apply Windows key combinations:
On the remote computer" is set). Using a second instance of kbremap on the remote
machine works fine as workaround.
* Compose key not avaible (yet)


## License

Licensed under either of
Expand Down
29 changes: 17 additions & 12 deletions config.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Example Dvorak layout configuration with comments.

# Layer to be used when no modifier key is pressed.
base_layer = "base"

# Associates the caps lock key and indicator light with a layer.
# Especially useful when the caps lock key is remapped and you accidentally use it
# from a program running with admin rights (where kbremap does not work).
# Windows remote desktop RDP also always captures your input with admin rights and
# changes your caps lock state even when running kbremap on your remote machine.
caps_lock_layer = "shift"

# Uncomment to disable the caps lock indicator entirely (even when enabled externally).
# Only disables the `VK_CAPITAL` virtual key. Layers can still be locked when configured below.
# To disable locking, uncomment the `layer_lock` action on the base layer.
# Uncomment to disable the caps lock indicator entirely (even when enabled externally,
# e.g. pressing the caps lock key when an elevated window has focus).
# Disables the `VK_CAPITAL` virtual key. Layers can still be locked with the `lock` target.
# To actually disable locking, comment out the `lock` target on the base layer.
# The "unreachable" layer is defined at the end of the file.
#caps_lock_layer = "unreachable"

Expand All @@ -25,13 +25,16 @@ caps_lock_layer = "shift"
# Scan codes without explicit mapping will use the default Windows layout to translate
# a key press to a [virtual key code](https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes).
#
# Use the debug output to observe scan code (sc) and virtual key code (vk) information while pressing keys.
# Use the debug output to observe scan code (sc) and virtual key code (vk) information while
# pressing keys. To see the debug output either run kbremap from the command line or enable the
# console output from the tray icon menu.
base = [
# The `characters` target remaps multiple keys to (Unicode) characters starting
# at `scan_code`. Increments `scan_code` by one for each following character.
# Simulates a virtual key press if the character exists on the active Windows layout
# so that keyborad shortcuts (e.g. Ctrl+a) continue to work as expected.
# Injects a Unicode symbol if the character is not available on the Windows layout.
# The `characters` target remaps multiple keys to (Unicode) characters.
# The first key to be mapped is specifed by `scan_code`. The scan code is incremented by one
# for each character, which means each key is mapped one character of the `characters` string.
# Simulates a virtual key press if the target character exists on the active Windows layout
# so that keyborad shortcuts (e.g. Ctrl+a) continue to work as expected. Injects a Unicode
# symbol if the target character is not available on the active Windows layout.
{ scan_code = 0x02, characters = "1234567890[]" },
{ scan_code = 0x10, characters = "',.pyfgcrl/=\\" },
{ scan_code = 0x1E, characters = "aoeuidhtns-" },
Expand All @@ -41,11 +44,13 @@ base = [
# Ignores the original scan code if no `virtual_key` is specified.
{ scan_code = 0x2A, layer = "shift", virtual_key = 0xA0 }, # left shift
{ scan_code = 0xE036, layer = "shift", virtual_key = 0xA1 }, # right shift

# The `lock` target locks the layer until the same key is pressed again.
{ scan_code = 0x3A, lock = "shift" }, # caps lock

# The `virtual_keys` works similar to the `characters` target but takes a collection of virtual keys.
# An empty target can be used to ignore scan codes.
{ scan_code = 0x021D, virtual_keys = [] }, # ignored additional scan code from `Alt Gr`
{ scan_code = 0x021D, virtual_keys = [] }, # ignore additional scan code from `Alt Gr`

# Emoji Keys!
# { scan_code = 0x29, characters = "🚀" }, # `~` on US layout, `^` on german layout
Expand Down
3 changes: 1 addition & 2 deletions neo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ caps_lock_layer = "2_shift"
{ scan_code = 0x2B, layer = "3_symbols" }, # `\` on US layout, `#` key on german layout
{ scan_code = 0x56, layer = "4_navigation_numpad" }, # `>` on german layout
{ scan_code = 0xE038, layer = "4_navigation_numpad" }, # `right alt` US layout, `Alt Gr` on german layout
{ scan_code = 0x021D, virtual_keys = [0] }, # ignored additional scan code from `Alt Gr`
{ scan_code = 0x021D, virtual_keys = [] }, # ignore additional scan code from `Alt Gr`
]

2_shift = [
Expand Down Expand Up @@ -51,7 +51,6 @@ caps_lock_layer = "2_shift"
{ scan_code = 0xE036, layer = "5_greek", virtual_key = 0xA1 }, # right shift
{ scan_code = 0x56, layer = "6_greek" }, # `>` on german layout
{ scan_code = 0xE038, layer = "6_greek" }, # `right alt` US layout, `Alt Gr` on german layout
{ scan_code = 0x021D, virtual_keys = [0] }, # ignored additional scan code from `Alt Gr`
]

4_navigation_numpad = [
Expand Down

0 comments on commit ab62562

Please sign in to comment.