Skip to content

Commit

Permalink
chore(clafrica): Remove function keys F1-12 (#62)
Browse files Browse the repository at this point in the history
The objective was to reserve these keys for a special purpose.
However, these keys are already being used by some programs.
Which can result in conflicts with our input method.
  • Loading branch information
pythonbrad committed Jul 10, 2023
1 parent 26f963a commit f197edd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- Improve the pause/resume way via double pressing of CTRL key. [(#54)](https://github.com/pythonbrad/clafrica/pull/54)
- Drop function key F1-12 which was reserved for special purposes. [(#62)](https://github.com/pythonbrad/clafrica/pull/62)

## [0.3.0] - 2023-06-02

Expand Down
7 changes: 2 additions & 5 deletions clafrica/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ pub fn run(config: config::Config, mut frontend: impl Frontend) -> Result<(), io
frontend.update_text(cursor.to_sequence());
}
EventType::KeyPress(
E_Key::Unknown(_) | E_Key::ShiftLeft | E_Key::ShiftRight | E_Key::CapsLock |
// Reserved for special purpose
E_Key::F1 | E_Key::F2 | E_Key::F3 | E_Key::F4 | E_Key::F5 | E_Key::F6 |
E_Key::F7 | E_Key::F8 | E_Key::F9 | E_Key::F10 | E_Key::F11 | E_Key::F12
E_Key::Unknown(_) | E_Key::ShiftLeft | E_Key::ShiftRight | E_Key::CapsLock,
) => {
// println!("[ignore] {:?}", event.event_type)
}
Expand All @@ -108,7 +105,7 @@ pub fn run(config: config::Config, mut frontend: impl Frontend) -> Result<(), io

if let Some(_in) = cursor.hit(character) {
rdev::simulate(&EventType::KeyPress(E_Key::Pause))
.expect("We could pause the listenerss");
.expect("We could pause the listeners");

keyboard.key_click(Key::Backspace);

Expand Down

0 comments on commit f197edd

Please sign in to comment.