All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
@ 2015-03-13  4:35 Programmingkid
  2015-03-13  9:51 ` Peter Maydell
  0 siblings, 1 reply; 25+ messages in thread
From: Programmingkid @ 2015-03-13  4:35 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel qemu-devel

Laptop users usually have keyboards that are missing the page up and page down keys. This means they cannot scroll in the monitor. This patch gives laptop users the ability to scroll in the monitor by having the user push the Control + Up/Down arrow keys to scroll one line at a time. Use ALT/Option in place of Control to be able to scroll at 10 lines at a time. 

Signed-off-by: John Arbuckle <programmingkidx@gmail.com>

---
 ui/cocoa.m |   82 ++++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 55 insertions(+), 27 deletions(-)

diff --git a/ui/cocoa.m b/ui/cocoa.m
index d37c29b..3ac847f 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -593,35 +593,63 @@ QemuCocoaView *cocoaView;
             // handlekeys for Monitor
             } else {
                 int keysym = 0;
-                switch([event keyCode]) {
-                case 115:
-                    keysym = QEMU_KEY_HOME;
-                    break;
-                case 117:
-                    keysym = QEMU_KEY_DELETE;
-                    break;
-                case 119:
-                    keysym = QEMU_KEY_END;
-                    break;
-                case 123:
-                    keysym = QEMU_KEY_LEFT;
-                    break;
-                case 124:
-                    keysym = QEMU_KEY_RIGHT;
-                    break;
-                case 125:
-                    keysym = QEMU_KEY_DOWN;
-                    break;
-                case 126:
-                    keysym = QEMU_KEY_UP;
-                    break;
-                default:
-                    {
-                        NSString *ks = [event characters];
-                        if ([ks length] > 0)
-                            keysym = [ks characterAtIndex:0];
+
+                /*
+                Holding down the up or down arrow key with the Control key scrolls the console one line.
+                Using the ALT/Option key with the up or down key scrolls the console 10 lines.
+                Had to do this because laptops don't have page up or page down keys.
+                */
+
+                // if the CONTROL key is held down
+                if([event modifierFlags] & NSControlKeyMask) {
+                    if([event keyCode] == 126) {         // up arrow key
+                        keysym = QEMU_KEY_CTRL_UP;
+                    } else if([event keyCode] == 125) {  // down arrow key
+                        keysym = QEMU_KEY_CTRL_DOWN;
+                    }
+                }
+
+                // if the ALT/OPTION key is held down
+                else if ([event modifierFlags] & NSAlternateKeyMask) {
+                    if ([event keyCode] == 126) {         // up arrow key
+                        keysym = QEMU_KEY_CTRL_PAGEUP;
+                    } else if ([event keyCode] == 125) {  // down arrow key
+                        keysym = QEMU_KEY_CTRL_PAGEDOWN;
                     }
                 }
+
+                else {
+                    switch([event keyCode]) {
+                    case 115:
+                        keysym = QEMU_KEY_HOME;
+                        break;
+                    case 117:
+                        keysym = QEMU_KEY_DELETE;
+                        break;
+                    case 119:
+                        keysym = QEMU_KEY_END;
+                        break;
+                    case 123:
+                        keysym = QEMU_KEY_LEFT;
+                        break;
+                    case 124:
+                        keysym = QEMU_KEY_RIGHT;
+                        break;
+                    case 125:
+                        keysym = QEMU_KEY_DOWN;
+                        break;
+                    case 126:
+                        keysym = QEMU_KEY_UP;
+                        break;
+                    default:
+                        {
+                            NSString *ks = [event characters];
+                            if ([ks length] > 0)
+                                keysym = [ks characterAtIndex:0];
+                        }
+                    }
+                }
+
                 if (keysym)
                     kbd_put_keysym(keysym);
             }
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-03-13  4:35 [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor Programmingkid
@ 2015-03-13  9:51 ` Peter Maydell
  2015-03-13 14:48   ` Programmingkid
  0 siblings, 1 reply; 25+ messages in thread
From: Peter Maydell @ 2015-03-13  9:51 UTC (permalink / raw)
  To: Programmingkid; +Cc: qemu-devel qemu-devel

On 13 March 2015 at 04:35, Programmingkid <programmingkidx@gmail.com> wrote:
> Laptop users usually have keyboards that are missing the page up and page down keys. This means they cannot scroll in the monitor. This patch gives laptop users the ability to scroll in the monitor by having the user push the Control + Up/Down arrow keys to scroll one line at a time. Use ALT/Option in place of Control to be able to scroll at 10 lines at a time.

Don't the standard OSX function+up/down for pageup/down work?
If they don't we should probably figure out why rather than
adding a non-standard key combo.

-- PMM

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-03-13  9:51 ` Peter Maydell
@ 2015-03-13 14:48   ` Programmingkid
  2015-03-13 17:31     ` Paolo Bonzini
  0 siblings, 1 reply; 25+ messages in thread
From: Programmingkid @ 2015-03-13 14:48 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel qemu-devel


On Mar 13, 2015, at 5:51 AM, Peter Maydell wrote:

> On 13 March 2015 at 04:35, Programmingkid <programmingkidx@gmail.com> wrote:
>> Laptop users usually have keyboards that are missing the page up and page down keys. This means they cannot scroll in the monitor. This patch gives laptop users the ability to scroll in the monitor by having the user push the Control + Up/Down arrow keys to scroll one line at a time. Use ALT/Option in place of Control to be able to scroll at 10 lines at a time.
> 
> Don't the standard OSX function+up/down for pageup/down work?
> If they don't we should probably figure out why rather than
> adding a non-standard key combo.
> 
> -- PMM

On my MacBook Pro, this functionality is missing. There is no way to do a page up or page down key. 

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-03-13 14:48   ` Programmingkid
@ 2015-03-13 17:31     ` Paolo Bonzini
  2015-03-13 20:43       ` Programmingkid
  0 siblings, 1 reply; 25+ messages in thread
From: Paolo Bonzini @ 2015-03-13 17:31 UTC (permalink / raw)
  To: Programmingkid, Peter Maydell; +Cc: qemu-devel qemu-devel



On 13/03/2015 15:48, Programmingkid wrote:
> 
> On Mar 13, 2015, at 5:51 AM, Peter Maydell wrote:
> 
>> On 13 March 2015 at 04:35, Programmingkid <programmingkidx@gmail.com> wrote:
>>> Laptop users usually have keyboards that are missing the page up and page down keys. This means they cannot scroll in the monitor. This patch gives laptop users the ability to scroll in the monitor by having the user push the Control + Up/Down arrow keys to scroll one line at a time. Use ALT/Option in place of Control to be able to scroll at 10 lines at a time.
>>
>> Don't the standard OSX function+up/down for pageup/down work?
>> If they don't we should probably figure out why rather than
>> adding a non-standard key combo.
>>
>> -- PMM
> 
> On my MacBook Pro, this functionality is missing. There is no way to do a page up or page down key. 

How do you do that in a terminal?

Paolo

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-03-13 17:31     ` Paolo Bonzini
@ 2015-03-13 20:43       ` Programmingkid
  2015-03-16 12:19         ` Paolo Bonzini
  2015-03-16 13:48         ` Daniel P. Berrange
  0 siblings, 2 replies; 25+ messages in thread
From: Programmingkid @ 2015-03-13 20:43 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Peter Maydell, qemu-devel qemu-devel


On Mar 13, 2015, at 1:31 PM, Paolo Bonzini wrote:

> 
> 
> On 13/03/2015 15:48, Programmingkid wrote:
>> 
>> On Mar 13, 2015, at 5:51 AM, Peter Maydell wrote:
>> 
>>> On 13 March 2015 at 04:35, Programmingkid <programmingkidx@gmail.com> wrote:
>>>> Laptop users usually have keyboards that are missing the page up and page down keys. This means they cannot scroll in the monitor. This patch gives laptop users the ability to scroll in the monitor by having the user push the Control + Up/Down arrow keys to scroll one line at a time. Use ALT/Option in place of Control to be able to scroll at 10 lines at a time.
>>> 
>>> Don't the standard OSX function+up/down for pageup/down work?
>>> If they don't we should probably figure out why rather than
>>> adding a non-standard key combo.
>>> 
>>> -- PMM
>> 
>> On my MacBook Pro, this functionality is missing. There is no way to do a page up or page down key. 
> 
> How do you do that in a terminal?
> 
> Paolo

I'm not sure what exactly you're asking. I will say past Apple laptop did have the ability to page up or down by using the function key + the up or down arrow keys. It looks like Apple removed that ability. I tried using function key + up, control key + up, option key + up, and command key + up. These do not cause the Monitor to scroll without the patch. 

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-03-13 20:43       ` Programmingkid
@ 2015-03-16 12:19         ` Paolo Bonzini
  2015-03-16 13:35           ` Programmingkid
  2015-03-16 13:48         ` Daniel P. Berrange
  1 sibling, 1 reply; 25+ messages in thread
From: Paolo Bonzini @ 2015-03-16 12:19 UTC (permalink / raw)
  To: Programmingkid; +Cc: Peter Maydell, qemu-devel qemu-devel



On 13/03/2015 21:43, Programmingkid wrote:
>> How do you do that in a terminal?
> 
> I'm not sure what exactly you're asking. I will say past Apple laptop
> did have the ability to page up or down by using the function key +
> the up or down arrow keys. It looks like Apple removed that ability.
> I tried using function key + up, control key + up, option key + up,
> and command key + up. These do not cause the Monitor to scroll
> without the patch.

How do you scroll up and down in OS X's Terminal.app?

Paolo

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-03-16 12:19         ` Paolo Bonzini
@ 2015-03-16 13:35           ` Programmingkid
  2015-03-16 13:36             ` Paolo Bonzini
  0 siblings, 1 reply; 25+ messages in thread
From: Programmingkid @ 2015-03-16 13:35 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Peter Maydell, qemu-devel qemu-devel


On Mar 16, 2015, at 8:19 AM, Paolo Bonzini wrote:

> 
> 
> On 13/03/2015 21:43, Programmingkid wrote:
>>> How do you do that in a terminal?
>> 
>> I'm not sure what exactly you're asking. I will say past Apple laptop
>> did have the ability to page up or down by using the function key +
>> the up or down arrow keys. It looks like Apple removed that ability.
>> I tried using function key + up, control key + up, option key + up,
>> and command key + up. These do not cause the Monitor to scroll
>> without the patch.
> 
> How do you scroll up and down in OS X's Terminal.app?
> 
> Paolo

With the scrollbar. 

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-03-16 13:35           ` Programmingkid
@ 2015-03-16 13:36             ` Paolo Bonzini
  2015-03-16 13:39               ` Programmingkid
  0 siblings, 1 reply; 25+ messages in thread
From: Paolo Bonzini @ 2015-03-16 13:36 UTC (permalink / raw)
  To: Programmingkid; +Cc: Peter Maydell, qemu-devel qemu-devel



On 16/03/2015 14:35, Programmingkid wrote:
> On Mar 16, 2015, at 8:19 AM, Paolo Bonzini wrote:
>> On 13/03/2015 21:43, Programmingkid wrote:
>>>> How do you do that in a terminal?
>>>
>>> I'm not sure what exactly you're asking. I will say past Apple laptop
>>> did have the ability to page up or down by using the function key +
>>> the up or down arrow keys. It looks like Apple removed that ability.
>>> I tried using function key + up, control key + up, option key + up,
>>> and command key + up. These do not cause the Monitor to scroll
>>> without the patch.
>>
>> How do you scroll up and down in OS X's Terminal.app?
> 
> With the scrollbar. 

And then people complain about GNOME...

Paolo

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-03-16 13:36             ` Paolo Bonzini
@ 2015-03-16 13:39               ` Programmingkid
  0 siblings, 0 replies; 25+ messages in thread
From: Programmingkid @ 2015-03-16 13:39 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Peter Maydell, qemu-devel qemu-devel


On Mar 16, 2015, at 9:36 AM, Paolo Bonzini wrote:

> 
> 
> On 16/03/2015 14:35, Programmingkid wrote:
>> On Mar 16, 2015, at 8:19 AM, Paolo Bonzini wrote:
>>> On 13/03/2015 21:43, Programmingkid wrote:
>>>>> How do you do that in a terminal?
>>>> 
>>>> I'm not sure what exactly you're asking. I will say past Apple laptop
>>>> did have the ability to page up or down by using the function key +
>>>> the up or down arrow keys. It looks like Apple removed that ability.
>>>> I tried using function key + up, control key + up, option key + up,
>>>> and command key + up. These do not cause the Monitor to scroll
>>>> without the patch.
>>> 
>>> How do you scroll up and down in OS X's Terminal.app?
>> 
>> With the scrollbar. 
> 
> And then people complain about GNOME...

??

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-03-13 20:43       ` Programmingkid
  2015-03-16 12:19         ` Paolo Bonzini
@ 2015-03-16 13:48         ` Daniel P. Berrange
  2015-03-16 14:00           ` Peter Maydell
  2015-03-16 14:33           ` Programmingkid
  1 sibling, 2 replies; 25+ messages in thread
From: Daniel P. Berrange @ 2015-03-16 13:48 UTC (permalink / raw)
  To: Programmingkid; +Cc: Paolo Bonzini, qemu-devel qemu-devel, Peter Maydell

On Fri, Mar 13, 2015 at 04:43:54PM -0400, Programmingkid wrote:
> 
> On Mar 13, 2015, at 1:31 PM, Paolo Bonzini wrote:
> 
> > 
> > 
> > On 13/03/2015 15:48, Programmingkid wrote:
> >> 
> >> On Mar 13, 2015, at 5:51 AM, Peter Maydell wrote:
> >> 
> >>> On 13 March 2015 at 04:35, Programmingkid <programmingkidx@gmail.com> wrote:
> >>>> Laptop users usually have keyboards that are missing the page up and page down keys. This means they cannot scroll in the monitor. This patch gives laptop users the ability to scroll in the monitor by having the user push the Control + Up/Down arrow keys to scroll one line at a time. Use ALT/Option in place of Control to be able to scroll at 10 lines at a time.
> >>> 
> >>> Don't the standard OSX function+up/down for pageup/down work?
> >>> If they don't we should probably figure out why rather than
> >>> adding a non-standard key combo.
> >>> 
> >>> -- PMM
> >> 
> >> On my MacBook Pro, this functionality is missing. There is no way to do a page up or page down key. 
> > 
> > How do you do that in a terminal?
> > 
> > Paolo
> 
> I'm not sure what exactly you're asking. I will say past Apple
> laptop did have the ability to page up or down by using the
> function key + the up or down arrow keys. It looks like Apple
> removed that ability. I tried using function key + up, control
> key + up, option key + up, and command key + up. These do not
> cause the Monitor to scroll without the patch.

The docs[1] still refer to fn+up/down as the way to achieve page up/down,
so perhaps your install has simply lost the shortcut mappings ?

Regards,
Daniel

[1] https://support.apple.com/en-gb/HT201236
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-03-16 13:48         ` Daniel P. Berrange
@ 2015-03-16 14:00           ` Peter Maydell
  2015-03-16 14:38             ` Programmingkid
  2015-03-16 14:33           ` Programmingkid
  1 sibling, 1 reply; 25+ messages in thread
From: Peter Maydell @ 2015-03-16 14:00 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: Programmingkid, qemu-devel qemu-devel, Paolo Bonzini

On 16 March 2015 at 13:48, Daniel P. Berrange <berrange@redhat.com> wrote:
> The docs[1] still refer to fn+up/down as the way to achieve page up/down,
> so perhaps your install has simply lost the shortcut mappings ?

Works for me on a 2011 MacBook Air running Mavericks, anyway.
(Terminal is not necessarily the best app to choose to demonstrate
this, because its behaviour is to pass the page-down/page-up through
to the application in the terminal.)

-- PMM

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-03-16 13:48         ` Daniel P. Berrange
  2015-03-16 14:00           ` Peter Maydell
@ 2015-03-16 14:33           ` Programmingkid
  1 sibling, 0 replies; 25+ messages in thread
From: Programmingkid @ 2015-03-16 14:33 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: Paolo Bonzini, qemu-devel qemu-devel, Peter Maydell


On Mar 16, 2015, at 9:48 AM, Daniel P. Berrange wrote:

> On Fri, Mar 13, 2015 at 04:43:54PM -0400, Programmingkid wrote:
>> 
>> On Mar 13, 2015, at 1:31 PM, Paolo Bonzini wrote:
>> 
>>> 
>>> 
>>> On 13/03/2015 15:48, Programmingkid wrote:
>>>> 
>>>> On Mar 13, 2015, at 5:51 AM, Peter Maydell wrote:
>>>> 
>>>>> On 13 March 2015 at 04:35, Programmingkid <programmingkidx@gmail.com> wrote:
>>>>>> Laptop users usually have keyboards that are missing the page up and page down keys. This means they cannot scroll in the monitor. This patch gives laptop users the ability to scroll in the monitor by having the user push the Control + Up/Down arrow keys to scroll one line at a time. Use ALT/Option in place of Control to be able to scroll at 10 lines at a time.
>>>>> 
>>>>> Don't the standard OSX function+up/down for pageup/down work?
>>>>> If they don't we should probably figure out why rather than
>>>>> adding a non-standard key combo.
>>>>> 
>>>>> -- PMM
>>>> 
>>>> On my MacBook Pro, this functionality is missing. There is no way to do a page up or page down key. 
>>> 
>>> How do you do that in a terminal?
>>> 
>>> Paolo
>> 
>> I'm not sure what exactly you're asking. I will say past Apple
>> laptop did have the ability to page up or down by using the
>> function key + the up or down arrow keys. It looks like Apple
>> removed that ability. I tried using function key + up, control
>> key + up, option key + up, and command key + up. These do not
>> cause the Monitor to scroll without the patch.
> 
> The docs[1] still refer to fn+up/down as the way to achieve page up/down,
> so perhaps your install has simply lost the shortcut mappings ?
> 
> Regards,
> Daniel
> 
> [1] https://support.apple.com/en-gb/HT201236
> -- 
> |: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
> |: http://libvirt.org              -o-             http://virt-manager.org :|
> |: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
> |: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

Your document does state that using fn+up/down arrow keys emulate the page up and down keys, but this isn't universally true for all Apple Laptops. My 2010 MacBook Pro is such an example of removed page up/down key emulation.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-03-16 14:00           ` Peter Maydell
@ 2015-03-16 14:38             ` Programmingkid
  2015-03-16 14:43               ` Peter Maydell
  0 siblings, 1 reply; 25+ messages in thread
From: Programmingkid @ 2015-03-16 14:38 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Paolo Bonzini, qemu-devel qemu-devel


On Mar 16, 2015, at 10:00 AM, Peter Maydell wrote:

> On 16 March 2015 at 13:48, Daniel P. Berrange <berrange@redhat.com> wrote:
>> The docs[1] still refer to fn+up/down as the way to achieve page up/down,
>> so perhaps your install has simply lost the shortcut mappings ?
> 
> Works for me on a 2011 MacBook Air running Mavericks, anyway.
Are you saying you are able to scroll up and down in QEMU's monitor using your MacBook Air's keyboard?

If your computer does have built-in emulation for the page up/down keys, would it still be ok to help the people whose computer don't have this feature?

http://xahlee.info/kbd/laptop_keyboards.html
This document states that the page up and down keys (as well as several other keys) have been removed from several manufacturer's laptops.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-03-16 14:38             ` Programmingkid
@ 2015-03-16 14:43               ` Peter Maydell
  2015-03-16 14:45                 ` Programmingkid
  0 siblings, 1 reply; 25+ messages in thread
From: Peter Maydell @ 2015-03-16 14:43 UTC (permalink / raw)
  To: Programmingkid; +Cc: Paolo Bonzini, qemu-devel qemu-devel

On 16 March 2015 at 14:38, Programmingkid <programmingkidx@gmail.com> wrote:
>
> On Mar 16, 2015, at 10:00 AM, Peter Maydell wrote:
>
>> On 16 March 2015 at 13:48, Daniel P. Berrange <berrange@redhat.com> wrote:
>>> The docs[1] still refer to fn+up/down as the way to achieve page up/down,
>>> so perhaps your install has simply lost the shortcut mappings ?
>>
>> Works for me on a 2011 MacBook Air running Mavericks, anyway.

> Are you saying you are able to scroll up and down in QEMU's monitor
> using your MacBook Air's keyboard?

I haven't attempted to use the monitor. I'm just saying that
on my OSX it does turn those keys into pageup/down.

-- PMM

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-03-16 14:43               ` Peter Maydell
@ 2015-03-16 14:45                 ` Programmingkid
  2015-03-16 14:47                   ` Paolo Bonzini
  2015-05-10 22:34                   ` Peter Maydell
  0 siblings, 2 replies; 25+ messages in thread
From: Programmingkid @ 2015-03-16 14:45 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Paolo Bonzini, qemu-devel qemu-devel


On Mar 16, 2015, at 10:43 AM, Peter Maydell wrote:

> On 16 March 2015 at 14:38, Programmingkid <programmingkidx@gmail.com> wrote:
>> 
>> On Mar 16, 2015, at 10:00 AM, Peter Maydell wrote:
>> 
>>> On 16 March 2015 at 13:48, Daniel P. Berrange <berrange@redhat.com> wrote:
>>>> The docs[1] still refer to fn+up/down as the way to achieve page up/down,
>>>> so perhaps your install has simply lost the shortcut mappings ?
>>> 
>>> Works for me on a 2011 MacBook Air running Mavericks, anyway.
> 
>> Are you saying you are able to scroll up and down in QEMU's monitor
>> using your MacBook Air's keyboard?
> 
> I haven't attempted to use the monitor. I'm just saying that
> on my OSX it does turn those keys into pageup/down.

Please try scrolling in the Monitor. I don't think it will work due to missing functionality.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-03-16 14:45                 ` Programmingkid
@ 2015-03-16 14:47                   ` Paolo Bonzini
  2015-03-16 14:49                     ` Programmingkid
  2015-05-10 22:34                   ` Peter Maydell
  1 sibling, 1 reply; 25+ messages in thread
From: Paolo Bonzini @ 2015-03-16 14:47 UTC (permalink / raw)
  To: Programmingkid, Peter Maydell; +Cc: qemu-devel qemu-devel



On 16/03/2015 15:45, Programmingkid wrote:
> > > Are you saying you are able to scroll up and down in QEMU's monitor
> > > using your MacBook Air's keyboard?
> > 
> > I haven't attempted to use the monitor. I'm just saying that
> > on my OSX it does turn those keys into pageup/down.
> 
> Please try scrolling in the Monitor. I don't think it will work due to missing functionality.

Just to understand what's going on, can you try using the GTK+ interface
on Mac OS X?  You should be able to scroll the terminal, if you have
libvte installed, with Shift+PgUp/Shift+PgDn (i.e.
Shift+Fn+Up/Shift+Fn/Down).

Paolo

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-03-16 14:47                   ` Paolo Bonzini
@ 2015-03-16 14:49                     ` Programmingkid
  2015-03-16 14:52                       ` Paolo Bonzini
  0 siblings, 1 reply; 25+ messages in thread
From: Programmingkid @ 2015-03-16 14:49 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Peter Maydell, qemu-devel qemu-devel


On Mar 16, 2015, at 10:47 AM, Paolo Bonzini wrote:

> 
> 
> On 16/03/2015 15:45, Programmingkid wrote:
>>>> Are you saying you are able to scroll up and down in QEMU's monitor
>>>> using your MacBook Air's keyboard?
>>> 
>>> I haven't attempted to use the monitor. I'm just saying that
>>> on my OSX it does turn those keys into pageup/down.
>> 
>> Please try scrolling in the Monitor. I don't think it will work due to missing functionality.
> 
> Just to understand what's going on, can you try using the GTK+ interface
> on Mac OS X?  You should be able to scroll the terminal, if you have
> libvte installed, with Shift+PgUp/Shift+PgDn (i.e.
> Shift+Fn+Up/Shift+Fn/Down).

Sorry but the GTK interface doesn't work on Mac OS X. We are all hoping this will change in the future. 

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-03-16 14:49                     ` Programmingkid
@ 2015-03-16 14:52                       ` Paolo Bonzini
  2015-03-16 14:59                         ` Peter Maydell
  2015-03-16 15:01                         ` Programmingkid
  0 siblings, 2 replies; 25+ messages in thread
From: Paolo Bonzini @ 2015-03-16 14:52 UTC (permalink / raw)
  To: Programmingkid; +Cc: Peter Maydell, qemu-devel qemu-devel



On 16/03/2015 15:49, Programmingkid wrote:
> 
> On Mar 16, 2015, at 10:47 AM, Paolo Bonzini wrote:
> 
>>
>>
>> On 16/03/2015 15:45, Programmingkid wrote:
>>>>> Are you saying you are able to scroll up and down in QEMU's monitor
>>>>> using your MacBook Air's keyboard?
>>>>
>>>> I haven't attempted to use the monitor. I'm just saying that
>>>> on my OSX it does turn those keys into pageup/down.
>>>
>>> Please try scrolling in the Monitor. I don't think it will work due to missing functionality.
>>
>> Just to understand what's going on, can you try using the GTK+ interface
>> on Mac OS X?  You should be able to scroll the terminal, if you have
>> libvte installed, with Shift+PgUp/Shift+PgDn (i.e.
>> Shift+Fn+Up/Shift+Fn/Down).
> 
> Sorry but the GTK interface doesn't work on Mac OS X. We are all hoping this will change in the future. 

What's the problem?  Was the bug reported?

Also, if you have dual booting, does Linux handle
Shift+Fn+Up/Shift+Fn+Down?  Fn is usually trapped and transformed in the
keyboard firmware.

Paolo

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-03-16 14:52                       ` Paolo Bonzini
@ 2015-03-16 14:59                         ` Peter Maydell
  2015-03-16 15:06                           ` Programmingkid
  2015-03-16 15:01                         ` Programmingkid
  1 sibling, 1 reply; 25+ messages in thread
From: Peter Maydell @ 2015-03-16 14:59 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Programmingkid, qemu-devel qemu-devel

On 16 March 2015 at 14:52, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>
> On 16/03/2015 15:49, Programmingkid wrote:
>> Sorry but the GTK interface doesn't work on Mac OS X. We are all hoping this will change in the future.
>
> What's the problem?  Was the bug reported?

Well known and longstanding -- the Cocoa UI assumes it
is the only thing present (and it hooks itself into
the startup sequence by overriding main() with its
own function). Yes, ideally we'd refactor it to work like
the other UIs, but in practice nobody really wants to
use anything other than the Cocoa UI on OSX so nobody's
got round to it.

-- PMM

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-03-16 14:52                       ` Paolo Bonzini
  2015-03-16 14:59                         ` Peter Maydell
@ 2015-03-16 15:01                         ` Programmingkid
  1 sibling, 0 replies; 25+ messages in thread
From: Programmingkid @ 2015-03-16 15:01 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Peter Maydell, qemu-devel qemu-devel


On Mar 16, 2015, at 10:52 AM, Paolo Bonzini wrote:

> 
> 
> On 16/03/2015 15:49, Programmingkid wrote:
>> 
>> On Mar 16, 2015, at 10:47 AM, Paolo Bonzini wrote:
>> 
>>> 
>>> 
>>> On 16/03/2015 15:45, Programmingkid wrote:
>>>>>> Are you saying you are able to scroll up and down in QEMU's monitor
>>>>>> using your MacBook Air's keyboard?
>>>>> 
>>>>> I haven't attempted to use the monitor. I'm just saying that
>>>>> on my OSX it does turn those keys into pageup/down.
>>>> 
>>>> Please try scrolling in the Monitor. I don't think it will work due to missing functionality.
>>> 
>>> Just to understand what's going on, can you try using the GTK+ interface
>>> on Mac OS X?  You should be able to scroll the terminal, if you have
>>> libvte installed, with Shift+PgUp/Shift+PgDn (i.e.
>>> Shift+Fn+Up/Shift+Fn/Down).
>> 
>> Sorry but the GTK interface doesn't work on Mac OS X. We are all hoping this will change in the future. 
> 
> What's the problem?  Was the bug reported?
I think the main problem is there is no Mac OS X/GTK user on the QEMU list who could help. Maybe a few Mac OS X/GTK users exist in the wild, but not very much evidence of this. 

> Also, if you have dual booting, does Linux handle
> Shift+Fn+Up/Shift+Fn+Down?  Fn is usually trapped and transformed in the
> keyboard firmware.

I have Linux installed in VirtualBox, when I tried the shift+fn+up/down keys, nothing happened. When I tried CNTL+UP/DOWN, then it worked. It looks like someone implemented my idea on Linux already!

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-03-16 14:59                         ` Peter Maydell
@ 2015-03-16 15:06                           ` Programmingkid
  0 siblings, 0 replies; 25+ messages in thread
From: Programmingkid @ 2015-03-16 15:06 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Paolo Bonzini, qemu-devel qemu-devel


On Mar 16, 2015, at 10:59 AM, Peter Maydell wrote:

> On 16 March 2015 at 14:52, Paolo Bonzini <pbonzini@redhat.com> wrote:
>> 
>> 
>> On 16/03/2015 15:49, Programmingkid wrote:
>>> Sorry but the GTK interface doesn't work on Mac OS X. We are all hoping this will change in the future.
>> 
>> What's the problem?  Was the bug reported?
> 
> Well known and longstanding -- the Cocoa UI assumes it
> is the only thing present (and it hooks itself into
> the startup sequence by overriding main() with its
> own function). Yes, ideally we'd refactor it to work like
> the other UIs, but in practice nobody really wants to
> use anything other than the Cocoa UI on OSX so nobody's
> got round to it.

That sounds about right. I would just like to add that nobody wants to have to install GTK and its dependencies after going thru the dependency nightmare that is QEMU. 

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-03-16 14:45                 ` Programmingkid
  2015-03-16 14:47                   ` Paolo Bonzini
@ 2015-05-10 22:34                   ` Peter Maydell
  2015-05-10 22:51                     ` Peter Maydell
  1 sibling, 1 reply; 25+ messages in thread
From: Peter Maydell @ 2015-05-10 22:34 UTC (permalink / raw)
  To: Programmingkid; +Cc: Paolo Bonzini, qemu-devel qemu-devel

On 16 March 2015 at 14:45, Programmingkid <programmingkidx@gmail.com> wrote:
> On Mar 16, 2015, at 10:43 AM, Peter Maydell wrote:
>> On 16 March 2015 at 14:38, Programmingkid <programmingkidx@gmail.com> wrote:
>>> On Mar 16, 2015, at 10:00 AM, Peter Maydell wrote:
>>>> On 16 March 2015 at 13:48, Daniel P. Berrange <berrange@redhat.com> wrote:
>>>>> The docs[1] still refer to fn+up/down as the way to achieve page up/down,
>>>>> so perhaps your install has simply lost the shortcut mappings ?
>>>>
>>>> Works for me on a 2011 MacBook Air running Mavericks, anyway.
>>
>>> Are you saying you are able to scroll up and down in QEMU's monitor
>>> using your MacBook Air's keyboard?
>>
>> I haven't attempted to use the monitor. I'm just saying that
>> on my OSX it does turn those keys into pageup/down.
>
> Please try scrolling in the Monitor. I don't think it will work due
> to missing functionality.

I've now tested again with my not-just-the-laptop setup, and:

 * in the guest OS (I tested with a Linux guest), PageUp/Down
   work OK and work the same whether I use an external USB
   keyboard with a physical PgUp/Down key or the MacBook Air's
   keyboard with Fn+UpArrow/Fn+DownArrow as the chord to
   input pageup/down
 * in the monitor window, neither way of inputting PageUp/Down
   works: all you get is a ',' input into the monitor

So my conclusion is that we should fix the underlying
problem that the monitor isn't handling PgUp/PgDown
correctly (not sure exactly why that's not working yet).

If your particular OSX version really doesn't implement
the Fn+Up/Down == PageUp/Down chord then I think you should
address that at the OSX level, not in QEMU (there are
likely several OSX utilities that will do the job).

thanks
-- PMM

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-05-10 22:34                   ` Peter Maydell
@ 2015-05-10 22:51                     ` Peter Maydell
  2015-05-11  6:53                       ` Gerd Hoffmann
  0 siblings, 1 reply; 25+ messages in thread
From: Peter Maydell @ 2015-05-10 22:51 UTC (permalink / raw)
  To: Programmingkid; +Cc: Paolo Bonzini, qemu-devel qemu-devel, Gerd Hoffmann

On 10 May 2015 at 23:34, Peter Maydell <peter.maydell@linaro.org> wrote:
> I've now tested again with my not-just-the-laptop setup, and:
>
>  * in the guest OS (I tested with a Linux guest), PageUp/Down
>    work OK and work the same whether I use an external USB
>    keyboard with a physical PgUp/Down key or the MacBook Air's
>    keyboard with Fn+UpArrow/Fn+DownArrow as the chord to
>    input pageup/down
>  * in the monitor window, neither way of inputting PageUp/Down
>    works: all you get is a ',' input into the monitor
>
> So my conclusion is that we should fix the underlying
> problem that the monitor isn't handling PgUp/PgDown
> correctly (not sure exactly why that's not working yet).

So looking at the code in ui/console.c that implements our
virtual consoles, the scrolling is hooked up to the keycodes
QEMU_KEY_CTRL_{UP,DOWN,PAGEUP,PAGEDOWN}. These only seem
to be output by one of our UI frontends, SDL.

Gerd, how is this supposed to work? Shouldn't something
in the generic console code be handling converting the
Q_KEY_CODE_CTRL/CTRL_R + Q_KEY_CODE_PGUP/DOWN/etc into
what the vc layer expects, rather than having each of the
ui frontends doing it?

thanks
-- PMM

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-05-10 22:51                     ` Peter Maydell
@ 2015-05-11  6:53                       ` Gerd Hoffmann
  2015-06-11 14:23                         ` Peter Maydell
  0 siblings, 1 reply; 25+ messages in thread
From: Gerd Hoffmann @ 2015-05-11  6:53 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Programmingkid, qemu-devel qemu-devel, Paolo Bonzini

On So, 2015-05-10 at 23:51 +0100, Peter Maydell wrote:
> On 10 May 2015 at 23:34, Peter Maydell <peter.maydell@linaro.org> wrote:
> > I've now tested again with my not-just-the-laptop setup, and:
> >
> >  * in the guest OS (I tested with a Linux guest), PageUp/Down
> >    work OK and work the same whether I use an external USB
> >    keyboard with a physical PgUp/Down key or the MacBook Air's
> >    keyboard with Fn+UpArrow/Fn+DownArrow as the chord to
> >    input pageup/down
> >  * in the monitor window, neither way of inputting PageUp/Down
> >    works: all you get is a ',' input into the monitor
> >
> > So my conclusion is that we should fix the underlying
> > problem that the monitor isn't handling PgUp/PgDown
> > correctly (not sure exactly why that's not working yet).
> 
> So looking at the code in ui/console.c that implements our
> virtual consoles, the scrolling is hooked up to the keycodes
> QEMU_KEY_CTRL_{UP,DOWN,PAGEUP,PAGEDOWN}. These only seem
> to be output by one of our UI frontends, SDL.
> 
> Gerd, how is this supposed to work? Shouldn't something
> in the generic console code be handling converting the
> Q_KEY_CODE_CTRL/CTRL_R + Q_KEY_CODE_PGUP/DOWN/etc into
> what the vc layer expects, rather than having each of the
> ui frontends doing it?

Unfortunaly it isn't that easy as we have two very different modes of
operation here:  For vc's we need the keyboard input already mapped to
your local keyboard layout (i.e. the keysyms).  For guest input we need
the raw scancodes of the keys as the keyboard layout handling is done by
the guest.  The differences between the UIs (especially when it comes to
raw scancodes) are big enough that it is next to impossible to hide all
that in common code.

Specifically for the vc control keys there is a little helper function
though: kbd_put_qcode_console(), used by sdl2 and gtk, which might be
useful for cocoa too.

cheers,
  Gerd

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor
  2015-05-11  6:53                       ` Gerd Hoffmann
@ 2015-06-11 14:23                         ` Peter Maydell
  0 siblings, 0 replies; 25+ messages in thread
From: Peter Maydell @ 2015-06-11 14:23 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: Programmingkid, qemu-devel qemu-devel, Paolo Bonzini

On 11 May 2015 at 07:53, Gerd Hoffmann <kraxel@redhat.com> wrote:
> On So, 2015-05-10 at 23:51 +0100, Peter Maydell wrote:
>> So looking at the code in ui/console.c that implements our
>> virtual consoles, the scrolling is hooked up to the keycodes
>> QEMU_KEY_CTRL_{UP,DOWN,PAGEUP,PAGEDOWN}. These only seem
>> to be output by one of our UI frontends, SDL.
>>
>> Gerd, how is this supposed to work? Shouldn't something
>> in the generic console code be handling converting the
>> Q_KEY_CODE_CTRL/CTRL_R + Q_KEY_CODE_PGUP/DOWN/etc into
>> what the vc layer expects, rather than having each of the
>> ui frontends doing it?
>
> Unfortunaly it isn't that easy as we have two very different modes of
> operation here:  For vc's we need the keyboard input already mapped to
> your local keyboard layout (i.e. the keysyms).  For guest input we need
> the raw scancodes of the keys as the keyboard layout handling is done by
> the guest.  The differences between the UIs (especially when it comes to
> raw scancodes) are big enough that it is next to impossible to hide all
> that in common code.
>
> Specifically for the vc control keys there is a little helper function
> though: kbd_put_qcode_console(), used by sdl2 and gtk, which might be
> useful for cocoa too.

I was just looking back at this, and I'm confused --
kbd_put_qcode_console() doesn't seem to do anything with the
QEMU_KEY_CTRL_* keycodes... And indeed ctrl-pageup/pagedown/up/down
don't work in the GTK UI, though they do work in the SDL1 UI.

-- PMM

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2015-06-11 14:24 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-13  4:35 [Qemu-devel] [PATCH] ui/cocoa.m: Give laptop users ability to scroll in monitor Programmingkid
2015-03-13  9:51 ` Peter Maydell
2015-03-13 14:48   ` Programmingkid
2015-03-13 17:31     ` Paolo Bonzini
2015-03-13 20:43       ` Programmingkid
2015-03-16 12:19         ` Paolo Bonzini
2015-03-16 13:35           ` Programmingkid
2015-03-16 13:36             ` Paolo Bonzini
2015-03-16 13:39               ` Programmingkid
2015-03-16 13:48         ` Daniel P. Berrange
2015-03-16 14:00           ` Peter Maydell
2015-03-16 14:38             ` Programmingkid
2015-03-16 14:43               ` Peter Maydell
2015-03-16 14:45                 ` Programmingkid
2015-03-16 14:47                   ` Paolo Bonzini
2015-03-16 14:49                     ` Programmingkid
2015-03-16 14:52                       ` Paolo Bonzini
2015-03-16 14:59                         ` Peter Maydell
2015-03-16 15:06                           ` Programmingkid
2015-03-16 15:01                         ` Programmingkid
2015-05-10 22:34                   ` Peter Maydell
2015-05-10 22:51                     ` Peter Maydell
2015-05-11  6:53                       ` Gerd Hoffmann
2015-06-11 14:23                         ` Peter Maydell
2015-03-16 14:33           ` Programmingkid

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.