omlins / JustSayIt.jl

Software and high-level API for offline, low latency and secure translation of human speech to computer commands or text on Linux, MacOS and Windows
BSD 3-Clause "New" or "Revised" License
87 stars 12 forks source link

remove commands from max speed subset not present in command dictionary #91

Closed omlins closed 1 year ago

omlins commented 1 year ago

Fixing revision comment:

In Fig 2, a using JustSayIt.API is required (same goes for the documentation at https://omlins.github.io/JustSayIt.jl/stable/usage/

julia> using JustSayIt

julia> #1) Define mapping of command names to functions, 
       #   keyboard shortcuts and command sequences.
       commands = Dict(
           "help"      => Help.help,
           "type"      => Keyboard.type,
           "ma"        => Mouse.click_left,
           "middle"    => Mouse.click_middle,
           "right"     => Mouse.click_right,
           "hold"      => Mouse.press_left,
           "release"   => Mouse.release_left,
           "undo"      => (Key.ctrl, 'z'),
           "redo"      => (Key.ctrl, Key.shift, 'z'),
           "take"      => [Mouse.click_double, 
                           (Key.ctrl, 'c')],
           "replace"   => [Mouse.click_double, 
                           (Key.ctrl, 'v')]
           )
Dict{String, Any} with 11 entries:
  "replace" => Any[click_double, (PyObject <Key.ctrl: <65507>>, 'v')]
  "ma"      => click_left
  "undo"    => (PyObject <Key.ctrl: <65507>>, 'z')
  "take"    => Any[click_double, (PyObject <Key.ctrl: <65507>>, 'c')]
  "hold"    => press_left
  "middle"  => click_middle
  "release" => release_left
  "right"   => click_right
  "help"    => help
  "redo"    => (PyObject <Key.ctrl: <65507>>, PyObject <Key.shift: <65505>>, 'z')
  "type"    => type

julia> #2) Start JustSayIt, activating max speed 
       #   recognition for a subset of the commands.
       start(commands=commands, 
             type_languages=["en-us", "fr"], 
             max_speed_subset=["ma", "middle", "right", 
             "hold", "release", "take"])
[ Info: JustSayIt: I am initializing...
[ Info: Listening for commands in English (United States) (say "sleep JustSayIt" to put me to sleep; press CTRL+c to terminate)...
codecov-commenter commented 1 year ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Please upload report for BASE (JuliaConProceeding2022@e76184f). Learn more about missing BASE report.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## JuliaConProceeding2022 #91 +/- ## ========================================================= Coverage ? 71.72% ========================================================= Files ? 17 Lines ? 1047 Branches ? 0 ========================================================= Hits ? 751 Misses ? 296 Partials ? 0 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.