how can i send a keyboard event to the app through pressing a button?
in fact i am building a virtual keyboard how can i send a keyboard event to the program through pressing a button? thanks ...
in fact i am building a virtual keyboard how can i send a keyboard event to the program through pressing a button? thanks ...
Howdy, I am trying to generate keyboard keydown and keyup events programmatically. I am currently using CGPostKeyboardEvent to do this, but I am searching for a way to do this at a lower level. I have looked at DDHidLib but could not figure out a way to create a fake event. Can anyone help? update: Thanks to weichsel's advice I am...
My code for my NSTextFieldCell is: - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { // Drawing code here. NSGradient *gradient = [[NSGradient alloc] initWithStartingColor:[NSColor lightGrayColor] endingColor:[NSColor grayColor]]; [gradient drawInRect:cellFrame angle:90]; [[self title] drawIn...
I have a array of NSString objects which I have to sort by descending. Since I did not find any API to sort the array in descending order I approached by following way. I wrote a category for NSString as listed bellow. (NSComparisonResult)CompareDescending:(NSString *)aString { NSComparisonResult returnResult = NSOrderedSame; r...
I'd like to be able to debug my application in the iPhone emulator. The app uses the Media Library Framework so I'm not really sure whether I'm able to add songs to the emulator and actually try out the app there. Is this possible? Right now I'm just using the iPod directly for this... Thanks, rui ...
Is it possible to draw in other processes windows on MacOSX using Cocoa or other libraries? If yes, are there any samples? Alternatively a quick summary of what i'd have to do? (I need to support at least OSX 10.5) Shared memory is of course a possible solution, but i'd prefer direct drawing to avoid synchronization overhead and code ...
So today I implement landscape mode for my app. It is an opengl es application. I rotated it 90 degrees. The first thing I notice is that the touches no longer work. The reason being is that the call to locationInView is still giving the coordinates as though the application is in portrait mode. How do people typically deal with this...
Hi - I open a window with the following: NSRect screenRect = [[NSScreen mainScreen] frame]; [super initWithContentRect:screenRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]; int windowLevel = CGShieldingWindowLevel(); [self setLevel:windowLevel]; ......
Hi all, I have a program with many windows open. I want all windows to be visible, but only one window can be interactable, until a certain event has occured. e.g. pressing a button. At the moment, I can still click another window, and interact with it, how do I only allow interaction with ONE window, until a certain event occurs? Ima...
I need to simulate a button press on my Cocoa button programatically and I am trying to do this on cocotron which unfortunately does not have the NSEvent method: mouseEventWithType:location:modifierFlags:timestamp:windowNumber:context:eventNumber:clickCount:pressure: implemented. Is there anyway to programatically simulate a button pre...
I've worked for hours on this and I just can't get it - should be really basic stuff but it's not getting thru my thick skull. I think it has to do with the coordinate system in Cocoa but I really don't know. This is all happening in the top pane of a horizontal NSSplitView. Very simply, I'm trying to position one NSBox right below a ...
i am creating a virtual for my application in IMK(input method kit) i failed to simulate keyboard event by pressing a button. is there any library i can used for the simulation? is there any materials/solutions i can reference to? thanks Reply With Quote ...
Hi, I've recently begun unit testing an app I write for the iPhone. I have the basics of creating my own tests down, even if it seems a little sub-optimal. I am, however, having real trouble setting up code coverage analysis using gcov. I followed the instructions here: http://www.cubiclemuses.com/cm/articles/2009/05/14/coverstory-on-t...
Hi all. Is it possible in Cocoa to move a window by dragging an object which is inside that window? For example: I have a webview inside a window, big as the window, so setMovableByWindowBackground will obviously not work. Is there a way to click and drag the web view and move the whole window? Any help would be very appreciated! —Alb...
my source-code as belowed : a part of source-code as belowed : - (id)init { NSFileHandle *fh =[[NSFileHandle alloc] initWithFileDescriptor:myfileDescriptor closeOnDealloc:YES]; NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; [notificationCenter addObserver:self selector: @selector(getData:) ...
My setup is an NSTableView with one column that is binded to the NSUserDefaults. Now that works perfectly, as long as nothing gets changed in my tableview. When I trie to change a value (all simple strings) i get the following error: Error setting value for key path of object Acid (from bound object <NSTableColumn: 0x1796ef10> ident...
Hello folks, I'm dealing with some asynchronous communication situations (Event-driven XML parsing, NSURLConnection response processing, etc.). I'll try to briefly explain my problem: In my current scenario, there is a service provider (that can talk to a xml parser or do some network communication) and a client that can ask the servi...
Unfortunately this is hard for me to test myself because I have yet to get a Magic Mouse of my own, but I've been told by my testers who do have a magic mouse that momentum scrolling isn't working in my app. I've not subclassed NSScrollView, but scrollview's document view is all custom. I have not overridden scrollWheel: anywhere, either...
I need to programatically remove a button from a window in Cocoa but the only method close to this was dealloc in NSObject, but this is not what I want to do. Is there a way to actually delete the button from the window not just deallocate its memory? ...
I'm trying to get a list of applications that are capable of opening a type of file. So far I've been able to get the name of a single application using NSWorkspace's getInfoForFile:application:type: method. Is there any API that I can call to get a list of applications capable of opening a file? ...