@@ -189,7 +189,7 @@ Usage example:
189
189
" %s (%s): "
190
190
prompt
191
191
(mapconcat (lambda (e ) (cdr e)) altered-names " , " )))
192
- tchar buf wrong-char answer)
192
+ tchar buf wrong-char answer command )
193
193
(save-window-excursion
194
194
(save-excursion
195
195
(if show-help
@@ -216,40 +216,76 @@ Usage example:
216
216
(let ((cursor-in-echo-area t ))
217
217
(read-event ))
218
218
(error nil ))))
219
- (setq answer (lookup-key query-replace-map (vector tchar) t ))
220
- (setq tchar
221
- (cond
222
- ((eq answer 'recenter )
223
- (recenter ) t )
224
- ((eq answer 'scroll-up )
225
- (ignore-errors (scroll-up-command )) t )
226
- ((eq answer 'scroll-down )
227
- (ignore-errors (scroll-down-command )) t )
228
- ((eq answer 'scroll-other-window )
229
- (ignore-errors (scroll-other-window )) t )
230
- ((eq answer 'scroll-other-window-down )
231
- (ignore-errors (scroll-other-window-down )) t )
232
- ((eq answer 'edit )
233
- (save-match-data
234
- (save-excursion
235
- (message " %s "
236
- (substitute-command-keys
237
- " Recursive edit; type \\ [exit-recursive-edit] to return to help screen" ))
238
- (recursive-edit ))))
239
- (t tchar)))
240
- (when (eq tchar t )
241
- (setq wrong-char nil
242
- tchar nil ))
243
- ; ; The user has entered an invalid choice, so display the
244
- ; ; help messages.
245
- (when (and (not (eq tchar nil ))
246
- (not (assq tchar choices)))
247
- (setq wrong-char (not (memq tchar `(?? , help-char )))
248
- tchar nil )
249
- (when wrong-char
250
- (ding ))
251
- (setq buf (rmc--show-help prompt help-string show-help
252
- choices altered-names))))))
219
+ (if (memq (car-safe tchar) '(touchscreen-begin
220
+ touchscreen-end
221
+ touchscreen-update))
222
+ ; ; Execute commands generally bound to certain touchscreen
223
+ ; ; events.
224
+ (progn
225
+ (when (setq command
226
+ (let ((current-key-remap-sequence
227
+ (vector tchar)))
228
+ (touch-screen-translate-touch nil )))
229
+ (setq command (if (> (length command) 0 )
230
+ (aref command 0 )
231
+ nil ))
232
+ (setq tchar nil )
233
+ (cond
234
+ ((null command)) ; Read another event.
235
+ ((memq (car-safe command) '(mouse-1 mouse-2))
236
+ ; ; Display the on-screen keyboard if a tap should be
237
+ ; ; registered.
238
+ (frame-toggle-on-screen-keyboard (selected-frame )
239
+ nil ))
240
+ ; ; Respond to scroll and pinch events as if RMC were
241
+ ; ; not in progress.
242
+ ((eq (car-safe command) 'touchscreen-scroll )
243
+ (funcall #'touch-screen-scroll command))
244
+ ((eq (car-safe command) 'touchscreen-pinch )
245
+ (funcall #'touch-screen-pinch command))
246
+ ; ; Prevent other touchscreen-generated events from
247
+ ; ; reaching the default conditional.
248
+ ((memq (or (and (symbolp command) command)
249
+ (car-safe command))
250
+ '(touchscreen-hold touchscreen-drag
251
+ touchscreen-restart-drag))
252
+ nil )
253
+ (t (setq tchar command)))))
254
+ (setq answer (lookup-key query-replace-map (vector tchar) t ))
255
+ (setq tchar
256
+ (cond
257
+ ((eq answer 'recenter )
258
+ (recenter ) t )
259
+ ((eq answer 'scroll-up )
260
+ (ignore-errors (scroll-up-command )) t )
261
+ ((eq answer 'scroll-down )
262
+ (ignore-errors (scroll-down-command )) t )
263
+ ((eq answer 'scroll-other-window )
264
+ (ignore-errors (scroll-other-window )) t )
265
+ ((eq answer 'scroll-other-window-down )
266
+ (ignore-errors (scroll-other-window-down )) t )
267
+ ((eq answer 'edit )
268
+ (save-match-data
269
+ (save-excursion
270
+ (message
271
+ " %s"
272
+ (substitute-command-keys
273
+ " Recursive edit; type \\ [exit-recursive-edit] to return to help screen" ))
274
+ (recursive-edit ))))
275
+ (t tchar)))
276
+ (when (eq tchar t )
277
+ (setq wrong-char nil
278
+ tchar nil ))
279
+ ; ; The user has entered an invalid choice, so display the
280
+ ; ; help messages.
281
+ (when (and (not (eq tchar nil ))
282
+ (not (assq tchar choices)))
283
+ (setq wrong-char (not (memq tchar `(?? , help-char )))
284
+ tchar nil )
285
+ (when wrong-char
286
+ (ding ))
287
+ (setq buf (rmc--show-help prompt help-string show-help
288
+ choices altered-names)))))))
253
289
(when (buffer-live-p buf)
254
290
(kill-buffer buf))
255
291
(assq tchar choices)))
0 commit comments