diff mbox

[2/2] ui/cocoa.m: send ctrl-alt key combinations to guest if not used by QEMU

Message ID 20170821205225.3401-1-programmingkidx@gmail.com
State New
Headers show

Commit Message

Programmingkid Aug. 21, 2017, 8:52 p.m. UTC
Send control-alt key combinations to the guest if not used by the user interface.

Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
---
 ui/cocoa.m | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Programmingkid Aug. 21, 2017, 8:52 p.m. UTC | #1
Currently if the user needs to send a control-alt key combination, he or she was either out of luck or had to rely on the monitor's sendkey command to do so. With this patch the user can now directly send control-alt key combinations. This is great for Windows guest that may need the control-alt-delete key combination. 

John Arbuckle (2):
  move ungrab to ctrl-alt-g
  send ctrl-alt key combinations to guest if not used by QEMU

 ui/cocoa.m | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)
diff mbox

Patch

diff --git a/ui/cocoa.m b/ui/cocoa.m
index d3e7907103..6920ea38aa 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -634,6 +634,14 @@  - (void) handleEvent:(NSEvent *)event
                     case Q_KEY_CODE_G:
                         [self ungrabMouse];
                         break;
+
+                    // send to the guest
+                    default:
+                        if (qemu_console_is_graphic(NULL)) {
+                            qemu_input_event_send_key_qcode(dcl->con, keycode,
+                                                            true);
+                        }
+                    break;
                 }
 
             // handle keys for graphic console