Re: Making Text Bigger and Smaller
Re: Making Text Bigger and Smaller
- Subject: Re: Making Text Bigger and Smaller
- From: Bill Monk <email@hidden>
- Date: Sat, 15 Jul 2006 13:20:09 -0500
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
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden