Skip to content

Commit

Permalink
Updated README and CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
houmain committed Aug 17, 2024
1 parent 1342ab9 commit 0fb2d24
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 deletions.
24 changes: 18 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,44 @@
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Version 4.6.1] - 2024-08-14
## [Version 4.7.0] - 2024-08-17

### Added
- Implemented `grab-device` directive support on Windows.

- Allow to define top-level macros:
```bash
macro = $0 >> $1
macro[A, B]
```

- Added builtin macros `repeat[EXPR, N]`, `length[STR]`, `add/sub/mul/div/mod/min/max[A, B]`.

- Apply further argument list to result of macro. e.g.:

```python
```bash
case1 = $0
case2 = $0 $0
switch = case$0
A >> switch[2][B] # switch generates case2, which is called with second argument list
```

- Implemented `@grab-device` directive support on Windows.

### Fixed
- `allow-unmapped-commands` also ignore mappings of undefined commands. e.g.:
- `@allow-unmapped-commands` also ignore mappings of undefined commands. e.g.:

```python
@allow-unmapped-commands
command >> A
```

- Added KDE6 support to keymapper KWin script.

## [Version 4.6.0] - 2024-08-07

### Added
- Allow string literals in input expressions. e.g. `'Abc' >> B`.
- Added `allow-unmapped-commands` and `enforce-lowercase-commands` directives.
- Added `@allow-unmapped-commands` and `@enforce-lowercase-commands` directives.

### Changed
- Keep key held when pressed immediately after `!Any`.
Expand Down Expand Up @@ -635,7 +647,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Version 1.1.5] - 2020-05-09

[version 4.6.1]: https://github.com/houmain/keymapper/compare/4.6.0...4.6.1
[version 4.7.0]: https://github.com/houmain/keymapper/compare/4.6.0...4.7.0
[version 4.6.0]: https://github.com/houmain/keymapper/compare/4.5.2...4.6.0
[version 4.5.2]: https://github.com/houmain/keymapper/compare/4.5.1...4.5.2
[version 4.5.1]: https://github.com/houmain/keymapper/compare/4.5.0...4.5.1
Expand Down
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,24 +284,32 @@ They can also be used in input expressions to match when the character are typed

:warning: The keyboard layout is evaluated when the configuration is loaded, switching is not yet supported.

### Key aliases
### Key aliases / Macros

For convenience aliases for keys and even sequences can be defined. e.g.:

```bash
Win = Meta
Boss = Virtual1
Alt = AltLeft | AltRight
Alt = AltLeft | AltRight # defines a logical key
proceed = Tab Tab Enter
greet = "Hello"
```

Aliases can also be parameterized. The arguments are provided in square brackets and referenced by `$0`, `$1`... e.g.:
```
An alias can also be parameterized to create a macro. The arguments are provided in square brackets and referenced by `$0`, `$1`... e.g.:
```bash
print = $(echo $0 $1 >> ~/keymapper.txt)
F1 >> print["pressed the key", F1]
```

There are a few builtin macros `repeat[EXPR, N]`, `length[STR]`, `add/sub/mul/div/mod/min/max[A, B]` which allow to define some more advanced macros. e.g:

```bash
# when last character of string is typed, undo using backspace and output new string
substitute = ? "$0" >> repeat[Backspace, sub[length["$0"], 1]] "$1"
substitute["Cat", "Dog"]
```
### Application launching
`$()` can be used in output expressions to embed commands, which should be executed when it is triggered. e.g.:
Expand Down

0 comments on commit 0fb2d24

Please sign in to comment.