Update app.py
Browse files
app.py
CHANGED
@@ -115,7 +115,7 @@ def video_frame_callback(frame: av.VideoFrame) -> av.VideoFrame:
|
|
115 |
cv2.rectangle(img, (x, y), (x + bw, y + bh), (0, 255, 160), -1)
|
116 |
cv2.putText(img, button.text, (x + int(0.2 * bw), y + int(0.7 * bh)), cv2.FONT_HERSHEY_PLAIN, font_scale, (255, 255, 255), font_thickness)
|
117 |
# # Handle button press
|
118 |
-
if (distance
|
119 |
if time.time() - prev_key_time[0] > 2:
|
120 |
prev_key_time[0] = time.time()
|
121 |
if button.text != 'BS' and button.text != 'SPACE':
|
|
|
115 |
cv2.rectangle(img, (x, y), (x + bw, y + bh), (0, 255, 160), -1)
|
116 |
cv2.putText(img, button.text, (x + int(0.2 * bw), y + int(0.7 * bh)), cv2.FONT_HERSHEY_PLAIN, font_scale, (255, 255, 255), font_thickness)
|
117 |
# # Handle button press
|
118 |
+
if (distance)<click_threshold:
|
119 |
if time.time() - prev_key_time[0] > 2:
|
120 |
prev_key_time[0] = time.time()
|
121 |
if button.text != 'BS' and button.text != 'SPACE':
|