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
84 stars 10 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

Codecov Report

:exclamation: No coverage uploaded for pull request base (JuliaConProceeding2022@e76184f). Click here to learn what that means. The diff coverage is n/a.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@                    Coverage Diff                    @@
##             JuliaConProceeding2022      #91   +/-   ##
=========================================================
  Coverage                          ?   71.72%           
=========================================================
  Files                             ?       17           
  Lines                             ?     1047           
  Branches                          ?        0           
=========================================================
  Hits                              ?      751           
  Misses                            ?      296           
  Partials                          ?        0           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.