(define-key special-event-map [drag-n-drop] 'android-handle-dnd-event)
+\f
+;; Bind keys sent by input methods to manipulate the state of the
+;; selection to commands which set or deactivate the mark.
+
+(defun android-deactivate-mark-command ()
+ "Deactivate the mark in this buffer.
+This command is generally invoked by input methods sending
+the `stop-selecting-text' editing key."
+ (interactive)
+ (deactivate-mark))
+
+(global-set-key [select-all] 'mark-whole-buffer)
+(global-set-key [start-selecting-text] 'set-mark-command)
+(global-set-key [stop-selecting-text] 'android-deactivate-mark-command)
+
\f
(provide 'android-win)
;; android-win.el ends here.
const char *buffer;
jmethodID method;
+ /* These keysyms are special editor actions sent by the input
+ method. */
+
+ switch (keysym)
+ {
+ case 65536 + 1:
+ strncpy (name_return, "select-all", size - 1);
+ name_return[size] = '\0';
+ return;
+
+ case 65536 + 2:
+ strncpy (name_return, "start-selecting-text", size - 1);
+ name_return[size] = '\0';
+ return;
+
+ case 65536 + 3:
+ strncpy (name_return, "stop-selecting-text", size - 1);
+ name_return[size] = '\0';
+ return;
+ }
+
method = service_class.name_keysym;
string
= (*android_java_env)->CallNonvirtualObjectMethod (android_java_env,
(jint) keysym);
android_exception_check ();
+ if (!string)
+ {
+ strncpy (name_return, "stop-selecting-text", size - 1);
+ name_return[size] = '\0';
+ return;
+ }
+
buffer = (*android_java_env)->GetStringUTFChars (android_java_env,
(jstring) string,
NULL);
switch (action)
{
+ /* The subsequent three keycodes are addressed by
+ android_get_keysym_name rather than in keyboard.c. */
+
case 0: /* android.R.id.selectAll */
+ key = 65536 + 1;
+ break;
+
case 1: /* android.R.id.startSelectingText */
+ key = 65536 + 2;
+ break;
+
case 2: /* android.R.id.stopSelectingText */
+ key = 65536 + 3;
+ break;
+
default:
- /* These actions are not implemented. */
return;
case 3: /* android.R.id.cut */