summaryrefslogtreecommitdiffstats
path: root/ui/input.c
Commit message (Collapse)AuthorAgeFilesLines
* qerror: Move #include out of qerror.hMarkus Armbruster2015-06-221-0/+1
| | | | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
* qerror: Eliminate QERR_DEVICE_NOT_FOUNDMarkus Armbruster2015-06-221-1/+2
| | | | | | | | | | | | | | | | | | Error classes other than ERROR_CLASS_GENERIC_ERROR should not be used in new code. Hiding them in QERR_ macros makes new uses hard to spot. Fortunately, there's just one such macro left. Eliminate it with this coccinelle semantic patch: @@ expression EP, E; @@ -error_set(EP, QERR_DEVICE_NOT_FOUND, E) +error_set(EP, ERROR_CLASS_DEVICE_NOT_FOUND, "Device '%s' not found", E) Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
* hmp: Name HMP command handler functions hmp_COMMAND()Markus Armbruster2015-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Some are called do_COMMAND() (old ones, usually), some hmp_COMMAND(), and sometimes COMMAND pointlessly differs in spelling. Normalize to hmp_COMMAND(), where COMMAND is exactly the command name with '-' replaced by '_'. Exceptions: * do_device_add() and client_migrate_info() *not* renamed to hmp_device_add(), hmp_client_migrate_info(), because they're also QMP handlers. They still need to be converted to QAPI. * do_memory_dump(), do_physical_memory_dump(), do_ioport_read(), do_ioport_write() renamed do hmp_* instead of hmp_x(), hmp_xp(), hmp_i(), hmp_o(), because those names are too cryptic for my taste. * do_info_help() renamed to hmp_info_help() instead of hmp_info(), because it only covers help. Signed-off-by: Markus Armbruster <armbru@redhat.com>
* input: move input-send-event into experimental namespaceGerd Hoffmann2014-11-251-2/+2
| | | | | | | | | | | | | | Ongoing discussions on how we are going to specify the console, so tag the command as experiental so we can refine things in the 2.3 development cycle. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1416923657-10614-1-git-send-email-armbru@redhat.com [Spell out "not a stable API", and x- the QAPI schema, too] Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Amos Kong <akong@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* QMP/input-send-event: make console parameter optionalAmos Kong2014-11-131-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'QemuConsole' is the input source for handler, we share some input handlers to process the input events from different QemuConsole. Normally we only have one set of keyboard, mouse, usbtablet, etc. The devices have different mask, it's fine to just checking mask to insure that the handler has the ability to process the event. I saw we try to bind console to handler in usb/dev-hid.c, but display always isn't available at that time. If we have multiseat setup (as Gerd said), we only have 'problem' in this case. Actually event from different devices have the same effect for system, it's fine to always use the first available handler without caring about the console. For send-key command, we just pass a NULL for console parameter in calling qemu_input_event_send_key(NULL, ..), but 'input-send-event' needs to care more devices. Conclusion: Generally assigning the special console is meanless, and we can't directly remove the QMP parameter for compatibility. So we can make the parameter optional. The parameter might be useful for some special condition: we have multiple devices without binding console and they all have the ability(mask) to process events, and we don't want to use the first one. Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Markus Armbruster <armbru@redhat.com> Cc: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Amos Kong <akong@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* add input-send-event commandMarcelo Tosatti2014-10-021-0/+37
| | | | | | | | | | | Which allows specification of absolute/relative, up/down and console parameters. Suggested by Gerd Hoffman. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* input: add support for kbd delaysGerd Hoffmann2014-06-041-3/+105
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* input: bind devices and input routingGerd Hoffmann2014-05-261-3/+40
| | | | | | | | Add function to bind input devices to display devices. Implementing input routing on top of this: Events coming from the display device in question are routed to the input device bound to it (if there is one). Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* input: add name to input_event_key_numberGerd Hoffmann2014-05-261-2/+4
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* input: add qemu_input_handler_deactivateGerd Hoffmann2014-05-161-0/+7
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* input: add sanity checkGerd Hoffmann2014-04-011-0/+3
| | | | | | Check we've actually found a input handler before trying to call it. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* input: mouse_set should check input device type.Hani Benhabiles2014-04-011-5/+11
| | | | | | | | | | | | | | | | | | Otherwise, the index of an input device like a usb-kbd is silently accepted. (qemu) info mice Mouse #2: QEMU PS/2 Mouse * Mouse #3: QEMU HID Mouse (qemu) mouse_set 1 (qemu) info mice Mouse #2: QEMU PS/2 Mouse * Mouse #3: QEMU HID Mouse Also replace monitor_printf() call in do_mouse_set() with error_report() and adjust error message. Signed-off-by: Hani Benhabiles <hani@linux.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* input: move do_mouse_set to new coreGerd Hoffmann2014-03-051-0/+21
| | | | | | | This removes the last user of the lecagy input mouse handler list, so we can remove more legacy bits with this. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* input: move qmp_query_mice to new coreGerd Hoffmann2014-03-051-0/+29
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* input: add input_mouse_mode tracepointGerd Hoffmann2014-03-051-0/+1
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* input: move mouse mode notifier to new coreGerd Hoffmann2014-03-051-0/+30
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* input: trace eventsGerd Hoffmann2014-03-051-0/+48
| | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* input: mouse: add qemu_input_is_absolute()Gerd Hoffmann2014-03-051-0/+8
| | | | | | Same as kbd_mouse_is_absolute(), but using new input core. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* input: mouse: add graphic_rotate supportGerd Hoffmann2014-03-051-0/+31
| | | | | | | | | | Transform absolute mouse events according to graphic_rotate. Legacy input code does it for both absolute and relative events, but the logic is broken for relative coordinates, so this is most likely not used anyway. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* input: mouse: add helpers functions to coreGerd Hoffmann2014-03-051-0/+71
| | | | | | | Likewise a bunch of helper functions to manage mouse button and movement events, again to make life easier for the ui code. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* input: keyboard: add helper functions to coreGerd Hoffmann2014-03-051-0/+35
| | | | | | | | A bunch of helper functions to manage keyboard events, to make life simpler for the ui code when submitting keyboard events. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* input: add core bits of the new input layerGerd Hoffmann2014-03-051-0/+83
| | | | | | | Register and unregister handlers. Event dispatcher code. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* input: rename file to legacyGerd Hoffmann2014-03-051-559/+0
| | | | | | | Rename ui/input.c to ui/input-legacy.c. We are going to replace it step by step. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* Don't crash on keyboard input with no handlerDon Koch2013-12-021-1/+1
| | | | | | | | | | Prevent a call to put_kbd if null. On shutdown of some OSes, the keyboard handler goes away before the system is down. If a key is typed during this window, qemu crashes. Signed-off-by: Don Koch <dkoch@verizon.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* aio / timers: Switch entire codebase to the new timer APIAlex Bligh2013-08-221-3/+3
| | | | | | | | | | | This is an autogenerated patch using scripts/switch-timer-api. Switch the entire code base to using the new timer API. Note this patch may introduce some line length issues. Signed-off-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* ui/input.c: replace magic numbers with macrosAmos Kong2013-05-231-6/+7
| | | | | | | | It's clearer to use defined macros than magic numbers. Signed-off-by: Amos Kong <akong@redhat.com> Reviewed-by: Lei Li <lilei@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* input: introduce keyboard handler listGerd Hoffmann2013-04-241-12/+25
| | | | | | | | | | | | | | | Add a linked list of keyboard handlers. Added handlers will go to the head of the list. Removed handlers will be zapped from the list. The head of the list will be used for events. This fixes the keyboard-dead-after-usb-kbd-unplug issue, key events will be re-routed to the ps/2 kbd instead of being discarded. [ v2: fix cut+paste bug found my Markus ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1366798118-3248-3-git-send-email-kraxel@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* input: make QEMUPutLEDEntry + QEMUPutMouseEntry privateGerd Hoffmann2013-04-241-0/+18
| | | | | | | | | | There is no need for anybody outside ui/input.c to access the struct elements. Move the definitions, leaving only the typedefs in the header files. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 1366798118-3248-2-git-send-email-kraxel@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* monitor: fix the wrong order of releasing keysAmos Kong2013-04-191-5/+3
| | | | | | | | | | | | | (qemu) sendkey ctrl_r-scroll_lock-scroll_lock Executing this command could not let Windows guest panic, it caused by the wrong order of releasing keys. This problem was introduced by commit e4c8f004c55d9da3eae3e14df740238bf805b5d6. The right release order should be starting from last item. Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
* error: Strip trailing '\n' from error string arguments (again)Markus Armbruster2013-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 6daf194d and be62a2eb got rid of a bunch, but they keep coming back. Tracked down with this Coccinelle semantic patch: @r@ expression err, eno, cls, fmt; position p; @@ ( error_report(fmt, ...)@p | error_set(err, cls, fmt, ...)@p | error_set_errno(err, eno, cls, fmt, ...)@p | error_setg(err, fmt, ...)@p | error_setg_errno(err, eno, fmt, ...)@p ) @script:python@ fmt << r.fmt; p << r.p; @@ if "\\n" in str(fmt): print "%s:%s:%s:%s" % (p[0].file, p[0].line, p[0].column, fmt) Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 1360354939-10994-4-git-send-email-armbru@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* softmmu: move include files to include/sysemu/Paolo Bonzini2012-12-191-1/+1
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* monitor: move include files to include/monitor/Paolo Bonzini2012-12-191-1/+1
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* qapi: move include files to include/qobject/Paolo Bonzini2012-12-191-1/+1
| | | | Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* ui: move files to ui/ and include/ui/Paolo Bonzini2012-12-191-0/+529
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
OpenPOWER on IntegriCloud