Exemple #1
0
 def repeat(self):
     repeater = Rep(1)
     repeater.ctx = talon
     repeater(None)
     if self.job:
         self.job = cron.after(self.repeat_delay, self.repeat)
         print('REPEAT')
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)
Exemple #3
0
def repeat(m):
    repeat_count = m_to_number(m)

    if repeat_count != None and repeat_count >= 2:
        repeater = Rep(repeat_count - 1)
        repeater.ctx = talon
        return repeater(None)
Exemple #4
0
def repeat(m):
    # repeater = Rep(int(ordinals[str(m)]))
    o = m.ordinals
    if isinstance(o, list):
        o = o[0]
    repeater = Rep(int(ordinals[o]))
    repeater.ctx = talon
    return repeater(None)
Exemple #5
0
def repeat(m):
    repeat_count = parse_words_as_integer(m._words[1:])
    print(talon.last)

    if repeat_count is not None and repeat_count >= 2:
        repeater = Rep(repeat_count - 1)
        repeater.ctx = talon
        return repeater(None)
Exemple #6
0
def repeat(m):
    # 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
    repeat_count = utils.m_to_number(m)

    if repeat_count != None and repeat_count >= 2:
        repeater = Rep(repeat_count - 1)
        repeater.ctx = talon
        return repeater(None)
Exemple #7
0
def repeat(m):

    words = m._words

    repeat_count = text_to_number(words[1:])
    print("Repeat! {} {}".format([str(w) for w in words], repeat_count))
    if not repeat_count:
        repeat_count = 1
    repeater = Rep(repeat_count)
    repeater.ctx = m.ctx
    return repeater(None)
Exemple #8
0
def repeat(m):
    # 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
    repeat_count = utils.extract_num_from_m(m)

    if repeat_count is not None:
        if repeat_count >= 2:
            repeat_count -= 1
        repeater = Rep(repeat_count)
        repeater.ctx = talon
        return repeater(None)
Exemple #9
0
def repeat(m):

    # noinspection PyProtectedMember
    words = m._words

    repeat_count = text_to_number(words[1:])
    print("Repeat! {} {}".format([str(w) for w in words], repeat_count))
    if not repeat_count:
        repeat_count = 1
    repeater = Rep(repeat_count)
    repeater.ctx = talon
    result = repeater(None)
    print(f"Result: {result}")
    return result
Exemple #10
0
def repeat(m):
    # 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
    starts_with_wink = m._words[0] == 'wink'
    if starts_with_wink and len(m._words) == 1:
        repeat_count = 1
    else:
        repeat_count = utils.extract_num_from_m(m)

    if repeat_count is not None:
        # for integrated repeats, need to subtract the first execution
        # "enter five times" will execute enter once and only then repeat, so need to subtract
        if not starts_with_wink and repeat_count >= 2:
            repeat_count -= 1

        repeater = Rep(repeat_count)
        repeater.ctx = talon
        return repeater(None)
Exemple #11
0
from talon.voice import Context, Rep, RepPhrase, talon
from .. import utils

ctx = Context("repeater")


def repeat(m):
    # 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
    repeat_count = utils.m_to_number(m)

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


ctx.keymap({
    "repple | wink":
    Rep(1),
    # "creek": RepPhrase(1),
    # "soup": Rep(2),
    # "trace": Rep(3),
    # "quarr": Rep(4),
    # "fypes": Rep(5),
    "(repeat | repple)" + utils.numerals:
    repeat,
})
Exemple #12
0
def repeat(m):
    o = m["repeater.ordinals"][0]
    repeater = Rep(int(ordinals[o]))
    repeater.ctx = talon
    return repeater(None)
Exemple #13
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 .. import utils

ctx = Context("repeater")


def repeat(m):
    # 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
    repeat_count = utils.extract_num_from_m(m)

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


ctx.keymap({
    "(wink | repple)": Rep(1),
    "creek": RepPhrase(1),
    "soup": Rep(2),
    "trace": Rep(3),
    "quarr": Rep(4),
    "fypes": Rep(5),
    "(repeat | repple)" + utils.numerals: repeat,
})
Exemple #14
0
from talon.voice import Context, Rep, RepPhrase, talon
from .. import utils

ctx = Context("repeater")


def repeat(m):
    # 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
    repeat_count = utils.extract_num_from_m(m)

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


ctx.keymap({
    "wink": Rep(1),
    "creek": RepPhrase(1),
    "soup": Rep(1),
    "trace": Rep(2),
    "quarr": Rep(3),
    "fypes": Rep(4),
    "(repeat | repple)" + utils.numerals: repeat,
})
Exemple #15
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 user.utils import m_to_number, numerals

ctx = Context('repeater')


def repeat(m):
    repeat_count = m_to_number(m)

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


ctx.keymap({
    'twice': Rep(1),
    'thrice': Rep(2),
    "(rep|repeat)" + numerals: repeat,
})
from .. import utils

ctx = Context("repeater")


def repeat(m):
    # 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
    repeat_count = utils.extract_num_from_m(m)

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


ctx.keymap(
    {
        "wink": Rep(1),
        "creek": RepPhrase(1),
        "soup": Rep(1),
        "trace": Rep(2),
        "(quarr | quart)": Rep(3),
        "( fypes | refive )": Rep(4),
        "(repeat | repple)" + utils.numerals: repeat,
    }
)
Exemple #17
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 .. import utils

ctx = Context("repeater")


def repeat(m):
    # 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
    repeat_count = utils.extract_num_from_m(m)

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


ctx.keymap({
    "wink": Rep(1),
    "soup": Rep(2),
    "trace": Rep(3),
    "(fard | fart)": Rep(4),
    "ficus": Rep(5),
    "(repeat | repple)" + utils.numerals: repeat,
})
Exemple #18
0
    # new-line-below
    'spronk': 'o',

    # find
    'marco': '/',
    # find-current
    'marthis': '*',
    # find-dictation
    'crew <dgndictation>': find_next_word,
    # find-next
    'marneck': 'n',
    # find-next
    'marprev': 'N',

    # repeat
    'rep': Rep(1),

    # center
    'zen': 'zz',

    # execute to the right
    'slap': [':w\n', lambda m: time.sleep(0.50),
             Key('cmd-right up enter')],

    # cut line
    'chomp': 'cc',

    # buffer-quit
    'barf': ':q\n',
    # buffer-write
    'sage': ':w\n',
Exemple #19
0
    'autopickup': Key('ctrl-a'),
    'item knowledge': '\\',

#    'twice': Rep(1),
#    'thrice': Rep(2),
#    'times four': Rep(3),
#    'times five': Rep(4),
#    'times six': Rep(5),
#    'ten': Rep(9),

    '(str | strength)': 's',
    '(int | intel | intelligence)': 'i',
    '(dex | dexterity)': 'd',
})

keymap.update({str(k): Rep(k - 1) for k in range(2, 11)})

'''
stepping = False
def stepthread():
    global stepping
    while stepping:
        press('f6')
        time.sleep(1)

def slowstep(j):
    global stepping
    stepping = True
    threading.Thread(target=stepthread).start()

def stopstep(j):
Exemple #20
0
#         * 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:])
    print(talon.last)

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


def repeat_delay(n, delay=0.09):
    for i in range(n):
        sleep(delay)
        repeater = Rep(i - 1)
        repeater.ctx = talon
        repeater(None)


ctx.keymap({
    'wink': Rep(1),
    'creek': RepPhrase(1),
    'soup': Rep(1),
    'trace': Rep(2),
    'quarr': Rep(3),
    # 'fypes': lambda m: repeat_delay(4),
    'fypes': Rep(4),
    # 'repeat (0 | oh | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9)+': repeat,
})
Exemple #21
0

# 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':
    Rep(4),
    'fypes':
    Rep(5),
    '(repeat | repple) (0 | oh | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9)+':
    repeat,
})
Exemple #22
0
def repeat_delay(n, delay=0.09):
    for i in range(n):
        sleep(delay)
        repeater = Rep(i - 1)
        repeater.ctx = talon
        repeater(None)
Exemple #23
0
# use this if you want `action trace` to result in action being executed 3 times
offset = -1
# use this if you want `action` pause `trace` to result in action being executed 4 times
# offset = 0


def repeat(m):
    # 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
    repeat_count = utils.extract_num_from_m(m)

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


ctx.keymap({
    "wink": Rep(1),
    "creek": RepPhrase(1),
    "soup": Rep(2 + offset),
    "trace": Rep(3 + offset),
    "quarr": Rep(4 + offset),
    "fypes": Rep(5 + offset),
    "(repeat | repple)" + utils.numerals: repeat,
})