Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 56 lines (49 sloc) 1.342 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
//
// 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
Something went wrong with that request. Please try again.