             defaults.setDouble(switchInterval, forKey: udkSwitchInterval)
         }
         intervalSlider.doubleValue = switchInterval
-        print(switchInterval);
+        print(switchInterval)
 
-        let desktopWindowNumber = getDesktopWindowNumber();
+        let desktopWindowNumber = getDesktopWindowNumber()
 
         NSEvent.addGlobalMonitorForEventsMatchingMask(.ScrollWheelMask, handler: { event in
 

}

func getDesktopWindowNumber() -> Int {
    var desktopWindowNumber = 0;
    let options = CGWindowListOption(arrayLiteral: CGWindowListOption.OptionOnScreenOnly)
    let infoList = CGWindowListCopyWindowInfo(options, CGWindowID(0))


            desktopWindowNumber = winDict["kCGWindowNumber"] as! Int
        }
    }
    return desktopWindowNumber
}

func postKeyDownAndUpEvents(keyCode: CGKeyCode, command:Bool, control:Bool, shift:Bool) {
    // there should be a better way...
    let flags = CGEventFlags(rawValue:
        ((command ? CGEventFlags.MaskCommand.rawValue : 0) |
            (control ? CGEventFlags.MaskControl.rawValue : 0) |
            (shift ? CGEventFlags.MaskShift.rawValue : 0)))!

    let src = CGEventSourceCreate(CGEventSourceStateID.HIDSystemState)
    let keyDownEvent = CGEventCreateKeyboardEvent(src, keyCode, true)
    let keyUpEvent = CGEventCreateKeyboardEvent(src, keyCode, false)

    CGEventSetFlags(keyDownEvent, flags)
    CGEventSetFlags(keyUpEvent, flags)

    let location = CGEventTapLocation.CGHIDEventTap
    CGEventPost(location, keyDownEvent)
    CGEventPost(location, keyUpEvent)
}

extension NSEventModifierFlags {
    func isSet(flag: NSEventModifierFlags) -> Bool {
        return self.rawValue & flag.rawValue == flag.rawValue
    }
}

