Making Text Bigger and Smaller
-
In Safari and Mail, there are shortcuts to make text bigger (Command
+) and smaller (Command -) that work whether the SHIFT key is pressed
down or not.
In the case of making text bigger (Command +) which requires you to
press the SHIFT key, Safari and Mail don't require it so you're
essentially pressing "Command =" but the shortcut in the menu says
"Command +".
Does anyone know how I can achieve the same effect?
Thanks! -
They're probably just connected directly to the text resizing methods.
--
Michael Watson
On 14 Jul, 2006, at 15:59, Shoaib Hannani wrote:
> In Safari and Mail, there are shortcuts to make text bigger
> (Command +) and smaller (Command -) that work whether the SHIFT key
> is pressed down or not.
>
> In the case of making text bigger (Command +) which requires you to
> press the SHIFT key, Safari and Mail don't require it so you're
> essentially pressing "Command =" but the shortcut in the menu says
> "Command +".
>
> Does anyone know how I can achieve the same effect?
>
> Thanks!
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (<Cocoa-dev...>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/mikey-san%
> 40bungie.org
>
> This email sent to <mikey-san...>
-
This is not what the OP is asking. The question was, to
paraphrase, how to trigger the "make it bigger" command with Cmd-=
instead of Cmd-shift-= when you've set the key equiv to Cmd-+ ...
I'm thinking the window itself could trap and respond to Cmd-= and
let the menu handle Cmd-+ normally. It may not be pretty but that's
how I achieve the same thing (subclassing NSWindow and responding to
the key combo, forwarding all others to super).
--
I.S.
On Jul 14, 2006, at 4:44 PM, Michael Watson wrote:
> They're probably just connected directly to the text resizing methods.
>
>
> --
> Michael Watson
>
> On 14 Jul, 2006, at 15:59, Shoaib Hannani wrote:
>
>> In Safari and Mail, there are shortcuts to make text bigger
>> (Command +) and smaller (Command -) that work whether the SHIFT
>> key is pressed down or not.
>>
>> In the case of making text bigger (Command +) which requires you
>> to press the SHIFT key, Safari and Mail don't require it so you're
>> essentially pressing "Command =" but the shortcut in the menu says
>> "Command +".
>>
>> Does anyone know how I can achieve the same effect?
>>
>> Thanks!
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Cocoa-dev mailing list (<Cocoa-dev...>)
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/mikey-san%
>> 40bungie.org
>>
>> This email sent to <mikey-san...>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (<Cocoa-dev...>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/idiotsavant2005%
> 40gmail.com
>
> This email sent to <idiotsavant2005...>
-
But would the menu then still flash as though a menu item had caught
the key equivalent?
Would it be better in your NSWindow or NSApp subclass to eat the Cmd-
= event and create a new Cmd-+ event from scratch?
Justin Anderson
On Jul 14, 2006, at 4:54 PM, I. Savant wrote:
>
> This is not what the OP is asking. The question was, to
> paraphrase, how to trigger the "make it bigger" command with Cmd-=
> instead of Cmd-shift-= when you've set the key equiv to Cmd-+ ...
>
> I'm thinking the window itself could trap and respond to Cmd-=
> and let the menu handle Cmd-+ normally. It may not be pretty but
> that's how I achieve the same thing (subclassing NSWindow and
> responding to the key combo, forwarding all others to super).
>
> --
> I.S.
-
On Jul 14, 2006, at 8:34 PM, Shoaib Hannani wrote:
> In Safari and Mail, there are shortcuts to make text bigger (Command
> +) and smaller (Command -) that work whether the SHIFT key is pressed
> down or not.
>
> In the case of making text bigger (Command +) which requires you to
> press the SHIFT key, Safari and Mail don't require it so you're
> essentially pressing "Command =" but the shortcut in the menu says
> "Command +".
>
> Does anyone know how I can achieve the same effect?
Carbon SetMenuItemCommandKey() can assign both a user-visible command
key (what the user thinks they are typing) and a "virtual" key (what
is actually typed).
A slight problem is getting a Carbon MenuRef from a Cocoa NSMenu.
Undocumented Goodness <http://www.cocoadev.com/index.pl?NSMenu>
mentions _NSGetCarbonMenu(NSMenu* aMenu), but I've never managed to
make that work....
Anyway, assuming a MenuRef to, say, the Help menu, Carbon set the
display keycode to Cmd-? and the virtual keycode to Cmd-/ , so it
doesn't matter if Shift is down or not.
MenuRef helpMenuRef; // getting this is left as an exercise for the
reader :) ...
// make Cmd-? work without having to hold down shift key
SetMenuItemCommandKey( helpMenuRef, 1, false, '?');
SetMenuItemCommandKey( helpMenuRef, 1, true, 0x2C ); // set virtual
key to '/', i.e Cmd-slash



