void CConfigShortcuts::KeyPressed(int Key) { switch (Key) { case VK_SHIFT: m_bShift = true; return; case VK_CONTROL: m_bControl = true; return; case VK_MENU: m_bAlt = true; return; } SetupKey(Key); }
void CConfigDlg::OnBnClicked(int nButton) { CString szNormal; CString szCtrl; CString szShift; m_cNormalEdit.GetWindowText(szNormal); m_cCtrlEdit.GetWindowText(szCtrl); m_cShiftEdit.GetWindowText(szShift); SetupKey(m_nCurrentButton, szNormal.GetBuffer(), szCtrl.GetBuffer(), szShift.GetBuffer()); m_nCurrentButton = nButton; PopulateControls(); }
IniKey::IniKey(const string& key) { SetupKey(key); }
void IniKey::ReKey(const string& key) { SetupKey(key); }
void CConfigDlg::DefaultKeys() { char bs[2] = {8,0}; SetupKey(VK_F12 , "\033[24~", "", "", "F12"); SetupKey(VK_F11 , "\033[23~", "", "", "F11"); SetupKey(VK_F10 , "\033[21~", "", "\033[34~", "F10"); SetupKey(VK_F9 , "\033[20~", "", "\033[33~", "F9 "); SetupKey(VK_F8 , "\033[19~", "", "\033[32~", "F8 "); SetupKey(VK_F7 , "\033[18~", "", "\033[31~", "F7 "); SetupKey(VK_F6 , "\033[17~", "", "\033[29~", "F6 "); SetupKey(VK_F5 , "\033[6~" , "\033[[5~", "\033[28~", "F5 "); SetupKey(VK_F4 , "\033OS" , "\033[[4~", "\033[26~", "F4 "); SetupKey(VK_F3 , "\033OR" , "\033[[3~", "\033[25~", "F3 "); SetupKey(VK_F2 , "\033OQ" , "\033[[2~", "\033[24~", "F2 "); SetupKey(VK_F1 , "\033OP" , "\033[[1~", "\033[23~", "F1 "); SetupKey(VK_UP , "\033[A" , "\033OA", "", "Up "); SetupKey(VK_DOWN , "\033[B" , "\033OB", "", "Down "); SetupKey(VK_RIGHT , "\033[C" , "\033OC", "", "Right "); SetupKey(VK_LEFT , "\033[D" , "\033OD", "", "Left "); SetupKey(VK_BACK , bs , "\033H", "", "Backspace "); SetupKey(VK_HOME , "\033[1~" , "", "\033[H", "Home "); SetupKey(VK_INSERT , "\033[2~" , "\033[L", "", "Insert"); SetupKey(VK_DELETE , "\033[3~" , "\033[M", "", "Delete"); SetupKey(VK_END , "\033[4~" , "\033[K", "", "End "); SetupKey(VK_PRIOR , "\033[5~" , "", "", "PageUp"); SetupKey(VK_NEXT , "\033[6~" , "\033[H\033[2J", "", "PageDown"); m_keyMap = m_tmpKeyMap; }
bool CClientFXDB::ReadFXKey( bool bText, ILTStream* pFxFile, float fTotalTime, FX_KEY* pKey, FX_PROP* pPropBuffer, uint32 nBuffLen ) { // Read in the reference name char sTmp[128]; if( bText ) { ReadTextFile( pFxFile, "%s %s", sTmp ); } else { pFxFile->Read(sTmp, 128); } pKey->m_pFxRef = FindFX( strtok(sTmp, ";" )); // Read in the key ID if( bText ) { ReadTextFile( pFxFile, "%s %lu", &pKey->m_dwID ); } else { pFxFile->Read(&pKey->m_dwID, sizeof(uint32)); } // Read in the link status LINK_STATUS ls; if( bText ) { ReadTextFile( pFxFile, "%s %i", &ls.m_bLinked ); ReadTextFile( pFxFile, "%s %lu", &ls.m_dwLinkedID ); //read in the linked node name but make sure that it is cleared out first ls.m_sLinkedNodeName[0] = '\0'; ReadTextFile( pFxFile, "%s %s", ls.m_sLinkedNodeName ); } else { pFxFile->Read(&ls, sizeof(LINK_STATUS)); } pKey->m_bLinked = ls.m_bLinked; pKey->m_dwLinkedID = ls.m_dwLinkedID; strcpy(pKey->m_sLinkedNodeName, ls.m_sLinkedNodeName); //check to make sure that the key is not motion linked to itself though if(pKey->m_bLinked && (pKey->m_dwLinkedID == pKey->m_dwID)) { pKey->m_bLinked = false; } // Read in the start time if( bText ) { ReadTextFile( pFxFile, "%s %f", &pKey->m_tmStart ); } else { pFxFile->Read(&pKey->m_tmStart, sizeof(float)); } // Read in the end time if( bText ) { ReadTextFile( pFxFile, "%s %f", &pKey->m_tmEnd ); } else { pFxFile->Read(&pKey->m_tmEnd, sizeof(float)); } // Read in the key repeat uint32 nKeyRepeats = 0; if( bText ) { ReadTextFile( pFxFile, "%s %lu", &nKeyRepeats ); } else { pFxFile->Read(&nKeyRepeats, sizeof(uint32)); } // Read in dummy values uint32 dwDummy; LTFLOAT fDummy; if( bText ) { ReadTextFile( pFxFile, "%s %lu", &dwDummy ); ReadTextFile( pFxFile, "%s %f", &fDummy ); ReadTextFile( pFxFile, "%s %f", &fDummy ); } else { pFxFile->Read(&dwDummy, sizeof(uint32)); pFxFile->Read(&dwDummy, sizeof(uint32)); pFxFile->Read(&dwDummy, sizeof(uint32)); } // Read in the number of properties uint32 dwNumProps; if( bText ) { ReadTextFile( pFxFile, "%s %lu", &dwNumProps ); } else { pFxFile->Read(&dwNumProps, sizeof(uint32)); } for (uint32 k = 0; k < dwNumProps; k ++) { if(k >= nBuffLen) { assert(!"Error: Found a key with too many properties, truncating additional properties"); break; } else { ReadFXProp( bText, pFxFile, pPropBuffer[k] ); } } //ok, we can now convert our properties over to the appropriate form int32 nFXID = FindFXID(pKey->m_pFxRef->m_sName); if(nFXID < 0) return false; //alright, get our property object pKey->m_pProps = m_pfnCreatePropList(nFXID); if(!pKey->m_pProps) return false; //make sure to clamp the times to always be between 0 and the length of the group, //otherwise numerical accuracy problems will arise pKey->m_tmStart = LTCLAMP(pKey->m_tmStart, 0.0f, fTotalTime); pKey->m_tmEnd = LTCLAMP(pKey->m_tmEnd, 0.0f, fTotalTime); //now setup the lifespan of the key pKey->m_pProps->SetLifetime(pKey->m_tmEnd - pKey->m_tmStart, nKeyRepeats); //and let it convert its properties if(!pKey->m_pProps->ParseProperties(pPropBuffer, k)) { m_pfnFreePropList(pKey->m_pProps); pKey->m_pProps = NULL; return false; } //setup this key (read out our keys and base properties) SetupKey(pKey, pPropBuffer, k); return true; }