コード例 #1
0
def release_keys():
  # clear all the still pressed keys after script finishes
  k.ReleaseKey(k.STRUM)
  k.ReleaseKey(k.STAR)
  for n in NOTES:
    k.ReleaseKey(n)
    time.sleep(0.1)
コード例 #2
0
def notes_worker():
    prev_notes, notes = note_q.get()
    for key in prev_notes:
        k.ReleaseKey(key)
    for key in notes:
        k.PressKey(key)
    k.PressKey(k.STRUM)
    time.sleep(0.025)  # doesn't block other threads!
    k.ReleaseKey(k.STRUM)
    time.sleep(0.025)
    note_q.task_done()
コード例 #3
0
def notes_worker():
    prev_notes = []
    while True:
        notes = note_q.get()
        for key in prev_notes:
            k.ReleaseKey(key)
        for key in notes:
            k.PressKey(key)
        k.PressKey(k.STRUM)
        time.sleep(0.017)
        k.ReleaseKey(k.STRUM)
        prev_notes = notes
コード例 #4
0
def release_keys():
    k.ReleaseKey(k.STRUM)
    k.ReleaseKey(k.STAR)
    for n in NOTES:
        k.ReleaseKey(n)
        time.sleep(0.1)