Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case14521 #67

Merged
merged 2 commits into from Nov 27, 2014
Merged

Case14521 #67

Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -73,6 +73,7 @@ - (void) ioGetNextEvent: (sqInputEvent *) evt {
ioProcessEvents();
id event = [eventQueue returnAndRemoveOldest];
if (event) {
NSLog(@"ioGetNextEvent:");
NSAutoreleasePool * pool = [NSAutoreleasePool new];
[self processAsOldEventOrComplexEvent: event placeIn: evt];
[event release];
@@ -149,14 +149,16 @@ - (void ) processAsOldEventOrComplexEvent: (id) event placeIn: (sqInputEvent *)
if ([[event objectAtIndex: 0] intValue] == 1) {
[(NSData *)[event objectAtIndex: 1] getBytes: evt length: sizeof(sqInputEvent)];
if (evt->type == EventTypeKeyboard) {
// NSLog(@"keyboard pc %i cc %i uc %i m %i",((sqKeyboardEvent *)evt)->pressCode,((sqKeyboardEvent *) evt)->charCode,((sqKeyboardEvent *) evt)->utf32Code,((sqKeyboardEvent *) evt)->modifiers);
NSLog(@"keyboard pc %i cc %i uc %i m %i",((sqKeyboardEvent *)evt)->pressCode,((sqKeyboardEvent *) evt)->charCode,((sqKeyboardEvent *) evt)->utf32Code,((sqKeyboardEvent *) evt)->modifiers);
}
return;
}
}

- (void) pushEventToQueue: (sqInputEvent *) evt {
NSMutableArray* data = [NSMutableArray new];

NSLog(@"sqSqueakOSXApplication+events.m>>pushEventToQueue:");
[data addObject: [NSNumber numberWithInteger: 1]];
[data addObject: [NSData dataWithBytes:(const void *) evt length: sizeof(sqInputEvent)]];
[eventQueue addItem: data];
@@ -171,6 +173,7 @@ - (void) recordCharEvent:(NSString *) unicodeString fromView: (NSView<sqSqueakOS
NSRange picker;
NSUInteger totaLength;

NSLog(@"sqSqueakOSXApplication+events>>recordCharEvent:fromView:");
evt.type = EventTypeKeyboard;
evt.timeStamp = (int) ioMSecs();
picker.location = 0;
@@ -227,6 +230,22 @@ - (void) recordCharEvent:(NSString *) unicodeString fromView: (NSView<sqSqueakOS

}

- (void) recordKeyDownEvent:(NSEvent *)theEvent fromView: (NSView<sqSqueakOSXView>*) aView {
sqKeyboardEvent evt;

evt.type = EventTypeKeyboard;
evt.timeStamp = (int) ioMSecs();
evt.charCode = [theEvent keyCode];
evt.pressCode = EventKeyDown;
evt.modifiers = [self translateCocoaModifiersToSqueakModifiers: [theEvent modifierFlags]];
evt.utf32Code = 0;
evt.reserved1 = 0;
evt.windowIndex = (int)[[aView windowLogic] windowIndex];
[self pushEventToQueue: (sqInputEvent *) &evt];

interpreterProxy->signalSemaphoreWithIndex(gDelegateApp.squeakApplication.inputSemaphoreIndex);
}

- (void) recordKeyUpEvent:(NSEvent *)theEvent fromView: (NSView<sqSqueakOSXView>*) aView {
sqKeyboardEvent evt;

@@ -339,6 +339,7 @@ -(void) fakeKeyDownUp: (NSEvent*) theEvent {
NSArray *down = [[NSArray alloc] initWithObjects: theEvent,nil];
@synchronized(self) {
lastSeenKeyBoardStrokeDetails = aKeyBoardStrokeDetails;

NSString *possibleConversion = [theEvent characters];

if ([possibleConversion length] > 0) {
@@ -357,6 +358,7 @@ -(void)keyDown:(NSEvent*)theEvent {
aKeyBoardStrokeDetails.modifierFlags = [theEvent modifierFlags];

NSArray *down = [[NSArray alloc] initWithObjects: theEvent,nil];
NSLog(@"sqSqueakOSXCGView.m>>keyDown:");
@synchronized(self) {
lastSeenKeyBoardStrokeDetails = aKeyBoardStrokeDetails;
[self interpretKeyEvents: down];
@@ -373,19 +375,24 @@ -(void)keyUp:(NSEvent*)theEvent {

- (void)insertText:(id)aString
{
NSLog(@"sqSqueakOSXCGView.m>>insertText:");

[(sqSqueakOSXApplication *) gDelegateApp.squeakApplication recordCharEvent: aString fromView: self];
}

- (void)insertText:(id)aString replacementRange:(NSRange)replacementRange
{
NSLog(@"sqSqueakOSXCGView.m>>insertText:replacementRange:");
[(sqSqueakOSXApplication *) gDelegateApp.squeakApplication recordCharEvent: aString fromView: self];
}

- (void)flagsChanged:(NSEvent *)theEvent {
NSLog(@"sqSqueakOSXCGView.m>>flagsChanged -- %d, %d", [theEvent keyCode], [theEvent modifierFlags] );
keyBoardStrokeDetails *aKeyBoardStrokeDetails = [[keyBoardStrokeDetails alloc] init];
aKeyBoardStrokeDetails.keyCode = [theEvent keyCode];
aKeyBoardStrokeDetails.modifierFlags = [theEvent modifierFlags];
self.lastSeenKeyBoardModifierDetails = aKeyBoardStrokeDetails;
[(sqSqueakOSXApplication *) gDelegateApp.squeakApplication recordKeyDownEvent: theEvent fromView: self];
[aKeyBoardStrokeDetails release];
}

@@ -677,4 +684,4 @@ - (void)fadeIn {
}
}

@end
@end
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.