mirror of
https://github.com/macports/pallet.git
synced 2026-03-31 14:39:01 -07:00
git-svn-id: https://svn.macports.org/repository/macports/branches/gsoc10-gui@70525 d073be05-634f-4543-b044-5fe20cf6d1d6
57 lines
1.3 KiB
Objective-C
57 lines
1.3 KiB
Objective-C
//
|
|
// MPPortTableView.m
|
|
// MPGUI
|
|
//
|
|
// Created by Juan Germán Castañeda Echevarría on 7/14/09.
|
|
// Copyright 2009 UNAM. All rights reserved.
|
|
//
|
|
|
|
#import "MPPortTableView.h"
|
|
|
|
|
|
@implementation MPPortTableView
|
|
|
|
-(id)init {
|
|
[quickLookPanel setFloatingPanel:YES];
|
|
|
|
[super init];
|
|
return self;
|
|
}
|
|
|
|
-(void)keyDown:(NSEvent *)theEvent {
|
|
if ([[theEvent characters] characterAtIndex:0] == ' ' ||
|
|
([[theEvent characters] characterAtIndex:0] == 27 && [quickLookPanel isVisible])) {
|
|
if ([quickLookPanel isVisible]) {
|
|
[quickLookPanel close];
|
|
} else {
|
|
[quickLookPanel makeKeyAndOrderFront:self];
|
|
[quickLookPanel makeFirstResponder:self];
|
|
}
|
|
} else {
|
|
[super keyDown:theEvent];
|
|
}
|
|
}
|
|
|
|
//flagsChanged is called every time a flag-changing key is pressed, like alt-ctrl-cmd etc
|
|
-(void)flagsChanged:(NSEvent *)theEvent
|
|
{
|
|
//We check if Alt is pressed
|
|
if([theEvent modifierFlags]&NSAlternateKeyMask)
|
|
{
|
|
NSLog(@"Alt is pressed");
|
|
altWasPressed=YES;
|
|
}
|
|
else
|
|
{
|
|
//If not, then if it's no longer pressed, we update our value. Otherwise, it means that
|
|
//this has nothing to do with us, so we let the system handle the flag change
|
|
if(altWasPressed)
|
|
{
|
|
NSLog(@"Alt is released");
|
|
altWasPressed=NO;
|
|
}
|
|
else [super flagsChanged:theEvent];
|
|
}
|
|
}
|
|
@end
|