Update app.py
Browse files
app.py
CHANGED
@@ -119,14 +119,14 @@ def video_frame_callback(frame: av.VideoFrame) -> av.VideoFrame:
|
|
119 |
# # Handle button press
|
120 |
if (distance / np.sqrt(bbox[2] ** 2 + bbox[3] ** 2)) * 100 < click_threshold:
|
121 |
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
|
131 |
|
132 |
|
|
|
119 |
# # Handle button press
|
120 |
if (distance / np.sqrt(bbox[2] ** 2 + bbox[3] ** 2)) * 100 < click_threshold:
|
121 |
|
122 |
+
if time.time() - prev_key_time[0] > 2:
|
123 |
+
prev_key_time[0] = time.time()
|
124 |
+
if button.text != 'BS' and button.text != 'SPACE':
|
125 |
+
st.session_state["output_text"] += button.text # Append key to output text
|
126 |
+
elif button.text == 'BS':
|
127 |
+
st.session_state["output_text"] = st.session_state["output_text"][:-1] # Remove last character
|
128 |
+
else:
|
129 |
+
st.session_state["output_text"] += ' ' # Add space
|
130 |
|
131 |
|
132 |
|