00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023
00024
00025
00026
00027 #include "HardKeyManager.h"
00028
00029
00030 void HardKeyManager::init()
00031 {
00032
00033 KeyRates(false, &oldInitDelay, &oldPeriod, &oldDoubleTapDelay, &oldQueueAhead);
00034
00035 setMask(keysAllowedMask);
00036 }
00037
00038
00039 void HardKeyManager::destroy()
00040 {
00041 releaseHardKeys();
00042 }
00043
00044
00045 void HardKeyManager::captureHardKeys()
00046 {
00047
00048 KeySetMask( ~mask );
00049 }
00050
00051
00052 void HardKeyManager::releaseHardKeys()
00053 {
00054 KeySetMask(keyBitsAll);
00055 KeyRates(true, &oldInitDelay, &oldPeriod, &oldDoubleTapDelay, &oldQueueAhead);
00056 }
00057
00058
00059 UInt32 HardKeyManager::getCurrentState()
00060 {
00061 return KeyCurrentState();
00062 }
00063
00064
00065 void HardKeyManager::setMask(UInt32 mask)
00066 {
00067 HardKeyManager::mask = mask;
00068 }
00069
00070
00071 UInt32 HardKeyManager::mask;
00072
00073 UInt16 HardKeyManager::oldInitDelay;
00074 UInt16 HardKeyManager::oldPeriod;
00075 UInt16 HardKeyManager::oldDoubleTapDelay;
00076 Boolean HardKeyManager::oldQueueAhead;