Q:

Turning on and off a loop from a Turtle input key

Another super green question, I'm sure of it:
I've been progressing with my metronome/sequencer passion and for a little background, I know that I will be putting this code into a Raspberry Pi and displaying info on a screen of some sort, so I have written this code and imported turtle in order to one day display it on a 320 x 240 screen.   
I have a loop that counts measures and beats and displays it in a turtle window measuring 320 x 240.   
I want to be able to press the right arrow on my keyboard to start the metronome and the left arrow on my keyboard to stop it.   
I have tried various versions of onkey(), onkeyrelease() & onkeypress() but don't know how to interrupt the loop to stop it or have it wait for a command to start it.   
code below:
import os
import time
import turtle
from turtle import *

win = turtle. Screen()
win.title("Beats & Measures")
win.bgcolor("black")
win.setup(width=240, height=320)
win.tracer(0)

pen1 = turtle. Turtle()
pen1.speed(0)
pen1.color("white")
pen1.penup()
pen1.hideturtle()
pen1.goto(150,-120)

pen2 = turtle. Turtle()
pen2.speed(0)
pen2.color("white")
pen2.penup()
pen2.hideturtle()
pen2.goto(160,-70)

pen3 = turtle. Turtle()
pen3.speed(0)
pen3.color("white")
pen3.penup()
pen3.hideturtle()
pen3.goto(-160,-70)

pen4 = turtle. Turtle()
pen4.speed(0)
pen4.color("white")
pen4.penup()
pen4.hideturtle()
pen4.goto(-160,-140)

three4 = range(1,4)
four4 = range(1,5)
six8 = range(1,7)
eighth = range(1,9)
twelfth = range(1,13)
sixteenth = range(1,17)
thirty2nd = range(1,33)

signatures = [three4,four4,six8,eighth,twelfth,sixteenth,thirty2nd]

beat = signatures[1]

pen3.write("Time Signature", align="left", font=('Digital-7 Mono', 18, 'bold'))
# pen4.write("Choose Time Signature: ", align="left", font=('Digital-7 Mono', 14, 'bold'))

def beatsMeasures():
    measure = 1
    while True:
        for i in beat:
            time.sleep(.5)
            pen2.write("measure : beat",align="right", font=('Digital-7 Mono', 18, 'bold'))
            pen1.clear()
            pen1.write("{}:{}".format(measure, i), align="right", font=('Digital-7 Mono', 48, 'normal'))
        measure = measure + 1

beatsMeasures()

A:

You'll likely not succeed with while True: and time.sleep() embedded in an event-driven environment like turtle.   Let's take your program apart and rebuild it using turtle's timer events:
from turtle import Screen, Turtle
from itertools import cycle, count

def nextBeat(beat, measure):
    pen1.clear()
    pen1.write("{}:{}".format(measure, beat), align='right', font=('Arial', 48, 'normal'))

    beat = next(beats)

    if beat == 1:
        if not pause:
            screen.ontimer(nextMeasure, 500)
    else:
        screen.ontimer(lambda: nextBeat(beat, measure), 500)

def nextMeasure():
    measure = next(measures)

    pen2.write("measure : beat", align='right', font=('Arial', 18, 'bold'))

    nextBeat(1, measure)

pause = False

def start():
    global pause

    pause = False

    nextMeasure()

def stop():
    global pause

    pause = True

screen = Screen()
screen.title("Beats & Measures")
screen.bgcolor('black')
screen.setup(width=400, height=300)
screen.tracer(0)

pen1 = Turtle()
pen1.hideturtle()
pen1.color('white')
pen1.penup()
pen1.goto(150, -120)

pen2 = pen1.clone()
pen2.goto(160, -70)

pen3 = pen2.clone()
pen3.goto(-160, -70)

three4 = range(1, 4)
four4 = range(1, 5)
six8 = range(1, 7)
eighth = range(1, 9)
twelfth = range(1, 13)
sixteenth = range(1, 17)
thirty2nd = range(1, 33)

signatures = [three4, four4, six8, eighth, twelfth, sixteenth, thirty2nd]

beats = cycle(signatures[1])

measures = count(1)

pen3.write("Time Signature", align='left', font=('Arial', 18, 'bold'))

screen.onkey(start, 'Right')
screen.onkey(stop, 'Left')
screen.listen()

nextMeasure()

screen.mainloop()

Pressing the left arrow key will stop the program, but in my simple implemenation, it will continue to beat to the end of the measure, then stop.   Pressing the right arrow key will resume at the start of the next measure.   Possibly not what you intended, but hopefully a starting point for what you need.