The function returns the state of the specified touch sensor of Quarky. If the touch pad is touched it will return True, else False.
![](https://ai.thestempedia.com/wp-content/uploads/2022/02/Touch-Numbers.gif)
The example demonstrates using the Quarky touch display to make a touch piano in the Python Coding Mode.
Code
sprite = Sprite('Tobi')
quarky = Quarky()
while True:
if quarky.ispadtouched("T1"):
quarky.drawpattern("bbbjjbjjbjjbbjjbjjjbjjbjjjbjjbjjbbb")
quarky.playtone("C4", 8)
if quarky.ispadtouched("T2"):
quarky.drawpattern("cccjcccjcjjjjcjcjjcccjcjjcjjjcjjccc")
quarky.playtone("D4", 8)
if quarky.ispadtouched("T3"):
quarky.drawpattern("fffjfffjfjjjjfjfjjfffjfjjjjfjfjjfff")
quarky.playtone("E4", 8)
if quarky.ispadtouched("T4"):
quarky.drawpattern("dddjdjdjdjjdjdjdjjdddjdjjjjdjdjjjjd")
quarky.playtone("F4", 8)
if quarky.ispadtouched("T5"):
quarky.drawpattern("gggjgggjgjjgjjjgjjgggjgjjjjgjgjjggg")
quarky.playtone("G4", 8)
Output
Read More