Ask a Question related to Mac Programming, Design and Development.
-
Andrew Clay #1
KeyFilters (Carbon)
I have an EditUnitcodeTextControl and what I want is for the keystrokes
to be converted to uppercase (ie when the user types 'a' in the control,
it is converted and displayed as 'A'.) Looking at the documentation, it
appears I should be able to create to user defined keyfilter routine
MyKeyFilter and attach it to the control like this :-
ControlKeyFilterUPP myControlKeyFilterUPP;
myControlKeyFilterUPP = NewControlKeyFilterUPP((ControlKeyFilterProcPtr)
MyKeyFilter); SetControlData(GetSysView(),kControlEntireControl,
kControlEditTextKeyFilterTag,
sizeof(
myControlKeyFilterUPP),&myControlKeyFilterUPP);
(I tried using InvokeControlKeyFilterUPP() but I don't know what it's
for and using SetControlData at least gets MyKeyFilter called in the
right place).
Now MyKeyFilter can block lowercase characters by returning
kControlKeyFilterBlockKey and that works fine; but whatever I modify the
input char to in MyKeyFilter() makes no difference.
Am I doing something wrong, is there a better way to achieve what I want,
or is this a bug in the documentation and you can't modify keystrokes
destined for a control using ControlKeyFilterProcPtr as described in the
Carbon Control Manager Reference?
Thanks for any advice.
Andrew Clay Guest
-
cfmail carbon copy
has anyone had a problem with send mail to a carbon copy or blind carbon copy? The "To" recipient receives the email fine, but the carbon copy... -
OSX Carbon Console???
How can I printf() or fprintf(stderr,) using the project builder for OSX Carbon? The debug thingy has a Standard I/O tab, but receives nothing...... -
Using Image Well with Carbon API
On Sun, 10 Aug 2003, yelko wrote: The obvious way would be to use an image well control, if not there's always DrawThemeGenericWell (from... -
Resource files and Carbon - PLEASE HELP!
I've been messing with this for hours, and am at my wit's end. If anyone has an ideas, please help! I find that when using FSpOpenResFile as a... -
Carbon Window Help
Michael Austin wrote: My Quickdraw is a little rusty, but shouldn't you be setting the device too? You can use SetGWorld. -Peter



Reply With Quote

