Ejemplo n.º 1
0
from talon.voice import Context, Key

ctx = Context("symbol")

keymap = {
    "randall": Key("esc"),
    "(question [mark] | questo)": "?",
    "(minus | dash)": "-",
    "plus": "+",
    "tilde": "~",
    "(bang | exclamation point | clamor)": "!",
    "(dollar [sign] | dolly)": "$",
    "(downscore | crunder)": "_",
    "(semi | semicolon | sunk)": ";",
    "colon": ":",
    "(square | left square [bracket] | brackorp)": "[",
    "(rsquare | are square | right square [bracket] | brackose)": "]",
    "(paren | left paren | precorp)": "(",
    "(rparen | are paren | right paren | precose)": ")",
    "(brace | left brace | kirksorp)": "{",
    "(rbrace | are brace | right brace | kirkos)": "}",
    "(angle | left angle | less than)": "<",
    "(rangle | are angle | right angle | greater than)": ">",
    "(star | asterisk)": "*",
    "(pound | hash [sign] | octo | number sign)": "#",
    "percent [sign]": "%",
    "caret": "^",
    "at sign": "@",
    "(and sign | ampersand | amper)": "&",
    "(pipe | spike)": "|",
    "(D pipe)": " | ",
Ejemplo n.º 2
0
from talon.voice import Context

# I'm using this to replace my use of words.py
ctx = Context('vocab_amy')

ctx.vocab = [
    # important to keep this in alphabetical order! Here's some R code to print and sort words:
    # sortedWords = sort(allWords)
    # test = paste0("'", paste(sortedWords, collapse="', '"), "'")
    # 'batch effects',
    # 'bal',
    # 'Bayes',
    # 'biostatistics',
    # 'Bryan',
    #
    # 'CAGs',
    # 'Cholesky',
    # 'cor',
    # 'corncob',
    # 'cov',
    #
    # 'dat',
    # 'deg',
    # 'dev',
    # 'dist',
    # 'dists',
    #
    # 'est',
    # 'exp',
    # 'expit',
    #
Ejemplo n.º 3
0
    for i, word in enumerate(words):
        word = parse_word(word).lower()
        for name in reversed(fmt):
            smash, func = formatters[name]
            word = func(i, word, i == len(words) - 1)
            spaces = spaces and not smash
        tmp.append(word)
    words = tmp

    sep = ' '
    if not spaces:
        sep = ''
    Str(sep.join(words))(None)


ctx = Context('input')

keymap = {}
keymap.update(alpha)
keymap.update({
    'phrase <dgndictation> [over]':
    text,
    'sentence <dgndictation> [over]':
    sentence_text,
    'comma <dgndictation> [over]': [', ', text],
    'period <dgndictation> [over]': ['. ', sentence_text],
    'more <dgndictation> [over]': [' ', text],
    'word <dgnwords>':
    word,
    '(%s)+ [<dgndictation>] [over]' % (' | '.join(formatters)):
    FormatText,
Ejemplo n.º 4
0
import string
import urllib.parse

from talon import ui
from talon.voice import Context, Key, press
from talon import ctrl
from ...utils import select_single, numerals, delay, paste_text
from ...misc.basic_keys import get_keys
from ...misc import basic_keys

ctx = Context(
    "google_sheets",
    func=lambda app, win: win.title.endswith("- Google Sheets") or
    "- Google Sheets -" in win.title,
)

# def get_url():
#     # TODO: retrieve url in a more direct way
#     press("cmd-l")
#     time.sleep(0.25)
#     copy_selected()


def get_url():
    win = ui.active_window()
    return win.children.find(AXTitle="Address and search bar")[0].AXValue


def set_url(url):
    # update the address bar with the updated URL
    paste_text(url)
Ejemplo n.º 5
0
import time
from talon import ctrl, tap
from talon.voice import Key, Context
from talon_plugins import eye_mouse
from talon_plugins.eye_mouse import Point2d

ctx = Context('mouse')
eye_mouse.config.velocity = 400
eye_mouse.config.acceleration = {
    'cd': (8, 65.0),
    'v': (0.0004, 0.0025),
    'lmb': 1000.0,
    'ratio': 0.7
}

x, y = ctrl.mouse_pos()
mouse_history = [(x, y, time.time())]
force_move = None


def on_move(typ, e):
    mouse_history.append((e.x, e.y, time.time()))
    if force_move:
        e.x, e.y = force_move
        return True


tap.register(tap.MMOVE, on_move)


def get_initial_mouse_pos(m):
Ejemplo n.º 6
0
from talon.voice import Word, Key, Context, Str
import string

terminals = ('com.apple.Terminal', 'com.googlecode.iterm2')
ctx = Context('terminal', func=lambda app, win: any(
    t in app.bundle for t in terminals))

keymap = {
    'cd': ['cd ; ls', Key('left'), Key('left'), Key('left'), Key('left')],
    'cd back': 'cd -; ls2\n',
    'cd develop': 'cd ~/dev; ls\n',
    'cd home': 'cd ~; ls\n',
    'cd up': 'cd ..; ls\n',

    'mux new': 'tmux new -s ',
    'mux attach': 'tmux attach -t ',
    'mux list': 'tmux ls\n',
    'mux horizontal': [Key('ctrl-b'), '\"'],
    'mux vertical': [Key('ctrl-b'), '%'],
    'mux leave': [Key('ctrl-b'), Key('d')],
    'mux scroll': [Key('ctrl-b'), Key('[')],

    'run list all': 'ls -lah\n',
    'run list long': 'ls -lh\n',
    'run get voice': ['git commit -am \' #talon\'', Key('alt-left'), Key('left')],
    'run bib': 'bibtex ',
    'run socks': 'ssh -D localhost:2020 ',
    'run grep': 'grep ',
    'run hawk': 'awk ',
    'run copy': 'cp -rf ',
    'run sink': 'rsync -ravh',
Ejemplo n.º 7
0
# originally from https://github.com/JonathanNickerson/talon_voice_user_scripts
# and https://github.com/pimentel/talon_user/blob/master/repeat.py

from talon.voice import Context, Rep, RepPhrase, talon
from ..utils import parse_words_as_integer

ctx = Context('repeater')


# TODO: This could be made more intelligent:
#         * Apply a timeout after which the command will not repeat previous actions
#         * Prevent stacking of repetitions upon previous repetitions
def repeat(m):
    repeat_count = parse_words_as_integer(m._words[1:])

    if repeat_count != None and repeat_count >= 2:
        repeater = Rep(repeat_count - 1)
        repeater.ctx = talon
        return repeater(None)


ctx.keymap({
    'wink':
    Rep(1),
    'creek':
    RepPhrase(1),
    'soup':
    Rep(2),
    'trace':
    Rep(3),
    'quarr':
Ejemplo n.º 8
0
# originally from https://github.com/JonathanNickerson/talon_voice_user_scripts
# and https://github.com/pimentel/talon_user/blob/master/repeat.py
# and https://github.com/dwiel/talon_community/blob/f72dabd505fed9a3a9fe304668412bc609b2094f/misc/repeat.py
from talon.voice import Context, Rep, RepPhrase, talon, Key, press
from .. import utils

ctx = Context("repeater")

# ordinals = {}

# def ordinal(n):
#     """
#     Convert an integer into its ordinal representation::
#         ordinal(0)   => '0th'
#         ordinal(3)   => '3rd'
#         ordinal(122) => '122nd'
#         ordinal(213) => '213th'
#     """
#     n = int(n)
#     suffix = ["th", "st", "nd", "rd", "th"][min(n % 10, 4)]
#     if 11 <= (n % 100) <= 13:
#         suffix = "th"
#     return str(n) + suffix

# for n in range(2, 100):
#     ordinals[ordinal(n)] = n - 1

# ctx.set_list("ordinals", ordinals.keys())

# def repeat_ordinal(m):
#     o = m["repeater.ordinals"][0]
Ejemplo n.º 9
0
from os import system

from talon.voice import Context, Key, press
from ..utils import parse_words_as_integer

ctx = Context("window_control")


def jump_tab(m):
    tab_number = parse_words_as_integer(m._words[1:])
    if tab_number is not None and tab_number > 0 and tab_number < 9:
        press("cmd-%s" % tab_number)


ctx.keymap({
    # tab control
    "((open | new) tab | peach)":
    Key("cmd-t"),
    "(close tab | totch)":
    Key("cmd-w"),
    "([switch] tab (right | next) | goneck)":
    Key("cmd-shift-]"),
    "([switch] tab (left | previous | preev) | gopreev)":
    Key("cmd-shift-["),
    "[switch] tab (1 | 2 | 3 | 4 | 5 | 6 | 7 | 8)":
    jump_tab,
    "[switch] tab (end | rightmost)":
    Key("cmd-9"),
    # zooming
    "zoom in":
    Key("cmd-="),
Ejemplo n.º 10
0
from talon.voice import Context, Key

ctx = Context('java', func=lambda app, win: win.doc.endswith('.java'))

keymap = {
    'state this': 'this.',
    'state and': ' && ',
    'state or': ' || ',
    'state super': 'super.',
    'state jason': 'Json',
    'state sequence': 'Seq',
    'state universe': 'UUID',
}

ctx.keymap(keymap)
Ejemplo n.º 11
0
import time

from .. import utils
from talon.voice import Context, Key

ctx = Context("sleep")


def sleep(m):
    seconds = extract_num_from_m(m, default=None)
    time.sleep(seconds)


ctx.keymap({"sleep" + utils.numerals: sleep})
Ejemplo n.º 12
0
    parse_words,
    rot13,
    sentence_text,
    surround,
    text,
    word,
)


def copy_bundle(m):
    bundle = ui.active_app().bundle
    clip.set(bundle)
    app.notify('Copied app bundle', body='{}'.format(bundle))


ctx = Context("input")

ctx.keymap({
    "say <dgndictation> [over]": text,
    "sentence <dgndictation> [over]": sentence_text,
    "comma <dgndictation> [over]": [", ", text],
    "period <dgndictation> [over]": [". ", sentence_text],
    "more <dgndictation> [over]": [" ", text],
    "word <dgnwords>": word,
    "slap": [Key("cmd-right enter")],
    "question [mark]": "?",
    "tilde": "~",
    "(bang | exclamation point)": "!",
    "dollar [sign]": "$",
    "downscore": "_",
    "colon": ":",
Ejemplo n.º 13
0
# from https://raw.githubusercontent.com/tuomassalo/atom-talon/master/atom.py

# Be sure to copy the instructions from
# https://github.com/tuomassalo/atom-talon
# to integrate with atom

from talon.voice import Key, press, Str, Context

## Note to self(Amy): `ctx = Context('atom', bundle='com.github.atom')` doesn't work
ctx = Context('Atom')

atom_hotkey = 'cmd-shift-ctrl-alt-t'


class Struct:
    def __init__(self, **entries):
        self.__dict__.update(entries)


# NB! These command names are duplicated in commands.js
COMMANDS = Struct(
    DELETE_TO_BOL='b',
    DELETE_TO_EOL='e',
    SELECT_LINES='s',
    FIND_NEXT='f',
    FIND_PREVIOUS='p',
    COPY_LINE='c',
    MOVE_LINE='m',
    SELECT_UNTIL='u',
)
Ejemplo n.º 14
0
    else:
        talon.disable()
        app.icon_color(1, 0, 0, 1)
    lib.menu_check(b'!Enable Speech Recognition', enable)


def on_menu(item):
    if item == '!Enable Speech Recognition':
        set_enabled(not talon.enabled)


app.register('menu', on_menu)
set_enabled(talon.enabled)

sleep_group = ContextGroup('sleepy')
sleepy = Context('sleepy', group=sleep_group)

sleepy.keymap({
    'talon sleep':
    lambda m: set_enabled(False),
    'talon wake':
    lambda m: set_enabled(True),
    'dragon mode':
    [lambda m: set_enabled(False), lambda m: engine.mimic('wake up'.split())],
    'talon mode': [
        lambda m: set_enabled(True),
        lambda m: engine.mimic('go to sleep'.split())
    ],
})
sleep_group.load()
Ejemplo n.º 15
0
def emoji_formatter(m):
    string = join_words(parse_words(m))
    insert(
        "".join([random.choice(alpha_to_emoji.get(c.lower(), [""])) for c in string])
    )


def emoji_reaction_formatter(m):
    string = join_words(parse_words(m))
    translated = [random.choice(alpha_to_emoji.get(c.lower(), [""])) for c in string]
    for t in translated:
        Str(f"+{t}\n")(m)
        time.sleep(0.7)


ctx = Context("slack", bundle="com.tinyspeck.slackmacgap")
ctx.keymap(
    {
        "next": [Key("f6")],
        "jump [<dgndictation>]": [Key("cmd-k"), text],
        "go (dm's | direct messages | messages)": Key("cmd-shift-k"),
        "go (and read | unread)": Key("cmd-shift-a"),
        "go (threads | thread)": Key("cmd-shift-t"),
        "go activity": Key("cmd-shift-m"),
        "go channel info": Key("cmd-shift-i"),
        "go status": Key("cmd-shift-y"),
        "go (star | stars | starred)": Key("cmd-shift-s"),
        "react [<dgndictation>]": ["+:", text],
        "emote [<dgndictation>]": [":", text],
        "toggle sidebar": Key("cmd-."),
        "go last unread": Key("alt-shift-up"),
Ejemplo n.º 16
0
from talon.voice import Context, Key, press
from talon import ctrl

ctx = Context(
    "google_slides",
    func=lambda app, win: win.title.endswith("- Google Slides") or
    "- Google Slides -" in win.title,
)
ctx.keymap({
    "(new slide | slide new)":
    Key("ctrl+m"),
    "(duplicate slide | slide duplicate)":
    [Key('cmd-alt-shift-f'), Key("cmd+d")],
    "undo":
    Key("cmd+z"),
    "redo":
    Key("cmd+y"),
    "copy":
    Key("cmd+c"),
    "cut":
    Key("cmd+x"),
    "paste":
    Key("cmd+v"),
    "copy formatting of the selected text or shape":
    Key("cmd+alt+c"),
    "paste formatting of the selected text or shape":
    Key("cmd+alt+v"),
    "insert or edit link":
    Key("cmd+k"),
    "open link":
    Key("alt+enter"),
Ejemplo n.º 17
0
from talon.voice import Word, Context, Key, Rep, Str, press
from talon_init import TALON_HOME, TALON_PLUGINS, TALON_USER
import time

ctx = Context('Terminal', bundle='com.apple.Terminal')

ctx.keymap({
    'cd': 'cd ',
    'cd talon home': 'cd {}'.format(TALON_HOME),
    'cd talon user': '******'.format(TALON_USER),
    'cd talon plugins': 'cd {}'.format(TALON_PLUGINS),
    'run make (durr | dear)': 'mkdir ',
    'run get': 'git ',
    'run get (R M | remove)': 'git rm ',
    'run get add': 'git add ',
    'run get branch': 'git branch ',
    'run get checkout': 'git checkout ',
    'run get clone': 'git clone ',
    'run get commit': ['git commit -a -m ""',
                       Key('left')],
    'run get diff': 'git diff ',
    'run get in it': 'git init ',
    'run get merge': 'git merge ',
    'run get move': 'git mv ',
    'run get pull': 'git pull ',
    'run get push': 'git push ',
    'run get status': 'git status ',
    'run (them | vim)': 'vim ',
    'run L S': 'ls\n',
    'dot pie': '.py',
    # 'run make': 'make\n',
Ejemplo n.º 18
0
from talon.voice import Key, Context

ctx = Context("iterm", bundle="com.googlecode.iterm2")

keymap = {
    "broadcaster": Key("cmd-alt-i"),
    "split horizontal": Key("cmd-shift-d"),
    "split vertical": Key("cmd-d"),
    "password": Key("cmd-alt-f"),
}

ctx.keymap(keymap)
Ejemplo n.º 19
0
def uppercase_letters(m):
    insert("".join(get_keys(m)).upper())


def press_keys(m):
    mods = get_modifiers(m)
    keys = get_keys(m)
    if mods:
        press("-".join(mods + [keys[0]]))
        keys = keys[1:]
    for k in keys:
        press(k)


ctx = Context("basic_keys")
ctx.keymap({
    "(uppercase | ship | sky) {basic_keys.alphabet}+ [(lowercase | sunk)]":
    uppercase_letters,
    "{basic_keys.modifiers}* {basic_keys.alphabet}+":
    press_keys,
    "{basic_keys.modifiers}* {basic_keys.digits}+":
    press_keys,
    "{basic_keys.modifiers}* {basic_keys.keys}+":
    press_keys,
    "(go | {basic_keys.modifiers}+) {basic_keys.arrows}+":
    press_keys,
})
ctx.set_list("alphabet", alphabet.keys())
ctx.set_list("digits", digits.keys())
ctx.set_list("keys", keys.keys())
Ejemplo n.º 20
0
    def warps(self):
        try:
            window = ui.active_window()
            bundle = window.app.bundle
            return self.data[bundle].keys()
        except Exception as e:
            print(e)
            return []

    def dump(self):
        with open(warps_file, "w") as f:
            json.dump(self.data, f, indent=2)


mj = MouseWarp()
ctx = Context("warp")
ctx.keymap({
    "mark <dgndictation> [over]": [
        lambda m: mj.mark(utils.join_words(utils.parse_words(m))),
        lambda _: ctx.set_list("warps", mj.warps()),
    ],
    "warp {warp.warps}": [lambda m: mj.warp(m["warp.warps"][0])],
    "list warps": [lambda _: app.notify("Warps:\n" + "\n".join(mj.warps()))],
    "click {warp.warps}": [
        lambda m: mj.warp(m["warp.warps"][0]),
        lambda _: ctrl.mouse_click(button=0),
    ],
})
ctx.set_list("warps", mj.warps())
Ejemplo n.º 21
0
import time

from talon.voice import Context, Key, press
from talon import clip
from user import utils

ctx = Context('emoji')

emojis = {
    'thumbs up': ':+1:',
    'okay hand': ':ok_hand:',
    'okay': ':ok_hand:',
    'check': ':white_check_mark:',
    'crossed fingers': ':crossed_fingers:',
    'fingers': ':crossed_fingers:',
    'fingers': ':crossed_fingers:',
    'pray': ':pray:',
}


def react(m):
    key = utils.join_words(m._words[1:])
    emojis[key]

    old_clipboard = clip.get()

    try:
        press('cmd-a', wait=2000)
        time.sleep(0.25)
        press('cmd-c', wait=2000)
        time.sleep(0.25)
Ejemplo n.º 22
0
from talon.voice import Context, Key, press
from talon import app, clip, ui
from .utils import parse_words, join_words, insert, parse_words_as_integer

ctx = Context('blake')


def git_commit(m):
    message = join_words(parse_words(m)).lower()
    text = 'git commit -m "%s"' % message
    insert(text)


def npm_run(m):
    message = join_words(parse_words(m)).lower()
    text = 'npm run %s' % message
    insert(text)


def multi_arrow(m):
    times = parse_words_as_integer(m._words[1:])
    if times > 0 and times < 10:
        for t in range(times):
            press(m._words[0])


def word_travel(m):
    times = parse_words_as_integer(m._words[2:])
    direction = m._words[1]
    repeat_press(times, 'alt-' + direction)
Ejemplo n.º 23
0
from talon.voice import Context, Key
from ..utils import text

ctx = Context("navigation")

keymap = {
    # scrolling
    "scroll down": [Key("down")] * 30,
    "scroll up": [Key("up")] * 30,
    # NB home and end do not work in all apps
    "(scroll way down | doomway)": Key("cmd-down"),
    "(scroll way up | jeepway)": Key("cmd-up"),
    "page up": [Key("pageup")],
    "page down": [Key("pagedown")],
}

ctx.keymap(keymap)
Ejemplo n.º 24
0
def press_keys(m):
    mods = get_modifiers(m)
    keys = get_keys(m)

    if mods == ["shift"] and all(key in alphabet.values() for key in keys):
        return uppercase_letters(m)

    if mods:
        press("-".join(mods + [keys[0]]))
        keys = keys[1:]
    for k in keys:
        press(k)


ctx = Context("basic_keys")
ctx.keymap({
    "(uppercase | ship | sky) {basic_keys.alphabet}+ [(lowercase | sunk)]":
    uppercase_letters,
    "{basic_keys.modifiers}* {basic_keys.alphabet}+":
    press_keys,
    "{basic_keys.modifiers}* {basic_keys.digits}+":
    press_keys,
    "{basic_keys.modifiers}* {basic_keys.keys}+":
    press_keys,
    "(go | {basic_keys.modifiers}+) {basic_keys.arrows}+":
    press_keys,
    "number {basic_keys.digits}+ [over]":
    press_keys,
    "tarsh":
    Key("shift-tab"),
Ejemplo n.º 25
0
from talon.voice import Context, Key, press
import talon.clip as clip
from ..utils import (
    text,
    parse_words,
    parse_words_as_integer,
    insert,
    word,
    join_words,
    is_filetype,
)

JS_EXTENSIONS = (".js", ".jsx", ".vue", ".ts")

context = Context("javascript", func=is_filetype(JS_EXTENSIONS))


def remove_spaces_around_dashes(m):
    words = parse_words(m)
    s = " ".join(words)
    s = s.replace(" – ", "-")
    insert(s)


def CursorText(s):
    left, right = s.split("{.}", 1)
    return [left + right, Key(" ".join(["left"] * len(right)))]


context.keymap({
    "static": "static ",
Ejemplo n.º 26
0
from talon.voice import Context, Key

from ..utils import text

PREFIX = "jet "

# Note that there are no application or window filters on this context because
# git may need to be used outside of the terminal, such as in a browser
# terminal, or you may need to send git commands to your friends to help them
# out with their git troubles.
ctx = Context("git")

ctx.keymap({
    # TODO: remove duplication between the two groups of commands as we really
    # only need one set of commands (eg by completing github issue #40 (use a
    # more comprehensive git grammar))
    # git commands originally from std.py
    # git commands originally from terminal.py
    # PREFIX + "[<dgndictation>]": ["git ", text],
    PREFIX + "add [<dgndictation>]": ["git add ", text],
    PREFIX + "add partial [<dgndictation>]": ["git add -p ", text],
    PREFIX + "bisect":
    "git bisect ",
    PREFIX + "branch":
    "git branch ",
    PREFIX + "branch set up stream to [<dgndictation>]": [
        "git branch --set-upstream-to=",
        text,
    ],
    PREFIX + "branch delete [<dgndictation>]": ["git branch -D ", text],
    PREFIX + "branch all [<dgndictation>]": ["git branch -a ", text],
Ejemplo n.º 27
0
from talon.voice import Context, Key, press
import talon.clip as clip
from ..utils import (
    text,
    parse_words,
    parse_words_as_integer,
    insert,
    word,
    join_words,
    is_filetype,
)

CSS_EXTENSIONS = (".css", ".scss")

context = Context("css", func=is_filetype(CSS_EXTENSIONS))

context.keymap({
    # --------------------------------------------------
    # common declarations
    # --------------------------------------------------
    "background image url":
    "background-image: url();",
    "clear both":
    "clear: both;",
    "cursor default":
    "cursor: default;",
    "cursor inherit":
    "cursor: inherit;",
    "cursor pointer":
    "cursor: pointer;",
    "display block":
Ejemplo n.º 28
0
import time

from talon.voice import Key, Context, Str, press
from talon_init import TALON_HOME, TALON_PLUGINS, TALON_USER
from talon import ctrl, ui

from ..utils import parse_words, text, is_in_bundles, insert
from .. import config
from ..misc.switcher import switch_app
from ..bundle_groups import TERMINAL_BUNDLES

# TODO: move application specific commands into their own files: apt-get, etc

ctx = Context("terminal", func=is_in_bundles(TERMINAL_BUNDLES))

mapping = {"semicolon": ";", r"new-line": "\n", r"new-paragraph": "\n\n"}


def parse_word(word):
    word = word.lstrip("\\").split("\\", 1)[0]
    word = mapping.get(word, word)
    return word


def dash(m):
    words = parse_words(m)
    press(" ")
    if len(words) == 1 and len(words[0]) == 1:
        press("-")
        Str(words[0])(None)
    else:
Ejemplo n.º 29
0
from talon.voice import Context, Key

apps = (
    "org.rstudio.RStudio",
    "com.googlecode.iterm2",
    "org.vim.MacVim",
    "com.sublimetext.3",
)
ctx = Context("R", func=lambda app, win: any(t in app.bundle for t in apps))

ctx.keymap(
    {
        "word d-plier":               "dplyr",
        "word tidier":                "tidyr",
        "word reshape 2":             "reshape2",
        "word G G plot":              "ggplot",
        "score (group | grouped) by": "group_by(",
        "score inner (join | joint)": "inner_join(",
        "score left (join | joint)":  "left_join(",
        "score bind (rows | rose)":   "bind_rows(",
        "geom point":                 "geom_point(",
        "geom line":                  "geom_line(",
        "geom point":                 "geom_point(",
        "geom segment":               "geom_segment(",
        "geom histogram":             "geom_histogram(",
        "geom bar":                   "geom_bar(",
        "geom area":                  "geom_area(",
        "geom violin":                "geom_violin(",
        "geom boxplot":               "geom_boxplot(",
        "geom pointrange":            "geom_pointrange(",
        "geom polygon":               "geom_polygon(",
Ejemplo n.º 30
0
from talon.voice import Context, Key, press
from talon import ctrl

titles = ('- Google Docs', '- Google Sheets', '- Google Slides')
ctx = Context('googleDocs', func=lambda app, win: win.title.endswith(titles))
ctx.keymap({
    'copy': Key('cmd+c'),
    'cut': Key('cmd+x'),
    'paste': Key('cmd+v'),
    'paste without formatting': Key('cmd+shift+v'),
    'undo': Key('cmd+z'),
    'redo': Key('cmd+shift+z'),
    'insert or edit link': Key('cmd+k'),
    'open link': Key('alt+enter'),
    'show common keyboard shortcuts': Key('cmd+/'),
    'save every change is automatically saved in drive': Key('cmd+s'),
    'print': Key('cmd+p'),
    'open': Key('cmd+o'),
    'find': Key('cmd+f'),
    'find and replace': Key('cmd+shift+h'),
    'find again': Key('cmd+g'),
    'find previous': Key('cmd+shift+g'),
    'hide the menus ': Key('ctrl+shift+f'),
    'insert page break': Key('cmd+enter'),
    'search the menus': Key('alt+/'),
    'bold': Key('cmd+b'),
    'italicize': Key('cmd+i'),
    'underline': Key('cmd+u'),
    'strikethrough': Key('cmd+shift+x'),
    'superscript': Key('cmd+.'),
    'subscript': Key('cmd+,'),