Skip to content

Commit

Permalink
Fixed shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
Benji377 committed Jan 19, 2025
1 parent 1f82956 commit 1d949a2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
A very simple text editor written in Rust. Its focused on simplicity and performance.

## Usage
It simply starts in the background at startup and waits for you to start typing the magic shortcut. Once you do, you can simply start typing and the texteditor will capture it right away.
Hide/Unhide this app using the magic shortcut. Once you do, you can simply start typing and the texteditor will capture it right away.
in _hide_ mode, it does not even pop-up, only you know its tracking your text (kind of like a Keylogger). In _normal_ mode it pops-up and you can use it as a simple notepad.

Magic shortcut: CTRL+ALT+SPACE

## Settings
Settings and customizations coming soon!

Expand Down
9 changes: 0 additions & 9 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
# TODO

## Background Task
> High priority
Make the app launch in the background and be always ready to input text.

Help:
- https://github.com/iced-rs/iced/issues/718
- https://discourse.iced.rs/t/how-to-map-control-s-to-a-keyboard-event/781

## Settings
> Medium-low priority
Expand Down
2 changes: 1 addition & 1 deletion src/editor/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl Editor {

// Registers hotkey for the app
let hotkey_manager = GlobalHotKeyManager::new().expect("Failed to create hotkey manager");
hotkey_manager.register(START_KEY).expect("Failed to register hotkey");
hotkey_manager.register(*START_KEY).expect("Failed to register hotkey");

(
Self {
Expand Down
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ use editor::editor::Editor;
mod editor;

static APP_NAME: &str = "SlightlyBetterText";
static START_KEY: HotKey = HotKey { id: 19012025, key: Code::Space, mods: Modifiers::META};
use std::sync::LazyLock;

static START_KEY: LazyLock<HotKey> = LazyLock::new(|| HotKey { id: 19012025, key: Code::Space, mods: Modifiers::CONTROL | Modifiers::ALT });

#[cfg(debug_assertions)]
static LOGGING_FILTER: LevelFilter = LevelFilter::Debug;
Expand All @@ -19,6 +21,7 @@ pub fn main() -> iced::Result {
let log_config = simplelog::ConfigBuilder::new()
.add_filter_ignore_str("wgpu_core")
.add_filter_ignore_str("cosmic_text")
.add_filter_ignore_str("naga")
.build();

TermLogger::init(
Expand Down

0 comments on commit 1d949a2

Please sign in to comment.