]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[client] Add ignore-keystroke command
authorCharlie Brej <cbrej@cs.man.ac.uk>
Thu, 3 Jun 2010 14:45:36 +0000 (15:45 +0100)
committerCharlie Brej <cbrej@cs.man.ac.uk>
Thu, 3 Jun 2010 14:45:36 +0000 (15:45 +0100)
Adds an ignore-keystroke command. This does the same thing as the
ignore-keystroke option, but is migrated to a command. The option still exists
for compatibility.

src/client/plymouth.c

index c219cf6ccf32dc8770dc4bf011ad145df9e859d8..f454a21f59c899613b04d15405db5e590c24eab0 100644 (file)
@@ -633,6 +633,27 @@ on_keystroke_request (state_t    *state,
                                                      key_answer_state);
 }
 
+static void
+on_keystroke_ignore (state_t    *state,
+                     const char *command)
+{
+  char *keys;
+
+  keys = NULL;
+  
+  ply_command_parser_get_command_options (state->command_parser,
+                                          command,
+                                          "keys", &keys,
+                                          NULL);
+
+  ply_boot_client_ask_daemon_to_ignore_keystroke (state->client,
+                                                  keys,
+                                                  (ply_boot_client_answer_handler_t)
+                                                  on_success,
+                                                  (ply_boot_client_response_handler_t)
+                                                  on_failure, state);
+}
+
 static void
 on_progress_pause_request (state_t    *state,
                            const char *command)
@@ -927,6 +948,14 @@ main (int    argc,
                                   PLY_COMMAND_OPTION_TYPE_STRING,
                                   NULL);
 
+  ply_command_parser_add_command (state.command_parser,
+                                  "ignore-keystroke", "Remove sensitivity to a keystroke",
+                                  (ply_command_handler_t)
+                                  on_keystroke_ignore, &state,
+                                  "keys", "Keys to remove sensitivity to",
+                                  PLY_COMMAND_OPTION_TYPE_STRING,
+                                  NULL);
+
   ply_command_parser_add_command (state.command_parser,
                                   "pause-progress", "Pause boot progress bar",
                                   (ply_command_handler_t)