本文整理汇总了C++中KeyMap::end方法的典型用法代码示例。如果您正苦于以下问题:C++ KeyMap::end方法的具体用法?C++ KeyMap::end怎么用?C++ KeyMap::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KeyMap
的用法示例。
在下文中一共展示了KeyMap::end方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: startConsole
void startConsole()
{
//intptr_t serverId = _spawnl(_P_NOWAIT, "TiGaServ.exe", "TiGaServ.exe", "15600" );
//intptr_t clientId = _spawnl(_P_NOWAIT, "TiGaClient.exe", "TiGaServ.exe", "localhost", "15600" );
bool exit = false;
KeyMap keyMap;
MENU_BEGIN('1',"Print menu")
printMenu(keyMap);
MENU_END();
MENU_BEGIN('2',"Start server")
system("start TiGaServ.exe 15600" );
//if( serverId == 0 )
// serverId = _spawnl(_P_NOWAITO, "TiGaServ.exe", "TiGaServ.exe", "15600" );
MENU_END();
MENU_BEGIN('3',"Start client")
system("start TiGaClient.exe 127.0.0.1 15600" );
//size_t id = spawnClient();
//printf("Client %d spawned\n",id);
MENU_END();
MENU_BEGIN(' ',"Exit")
exit = true;
MENU_END();
printMenu(keyMap);
while(exit != true)
{
int ch = getch();
KeyMap::iterator it = keyMap.find(ch);
if( it != keyMap.end() )
it->second.second();
}
}
示例2: printMenu
void printMenu(KeyMap & keyMap)
{
for( auto it = keyMap.begin(); it != keyMap.end(); ++it)
{
printf("%c.\t%s\n",it->first, it->second.first);
}
}
示例3: make_key
static rinteger make_key(Env* env, Method* meth, KeyMap& keys) {
KeyMap::iterator iter = keys.find(meth);
if(iter == keys.end()) {
rinteger key = env->integer_new(keys.size());
keys[meth] = key;
return key;
}
return iter->second;
}
示例4: updateState
void DirectInputRegistry::updateState( osgGA::EventQueue* eventQueue )
{
HRESULT hr;
if ( !_supportDirectInput || !eventQueue ) return;
if ( _keyboard )
{
pollDevice( _keyboard );
char buffer[256] = {0};
hr = _keyboard->GetDeviceState( sizeof(buffer), &buffer );
if ( SUCCEEDED(hr) )
{
for ( KeyMap::iterator itr=g_keyMap.begin(); itr!=g_keyMap.end(); ++itr )
{
KeyValue& key = itr->second;
char value = buffer[itr->first];
if ( key.second==value ) continue;
key.second = value;
if ( value&0x80 )
eventQueue->keyPress( key.first );
else
eventQueue->keyRelease( key.first );
}
}
}
if ( _mouse )
{
pollDevice( _mouse );
DIMOUSESTATE2 mouseState;
hr = _mouse->GetDeviceState( sizeof(DIMOUSESTATE2), &mouseState );
// TODO: add mouse handlers
}
if ( _joystick )
{
pollDevice( _joystick );
osg::ref_ptr<JoystickEvent> event = new JoystickEvent;
hr = _joystick->GetDeviceState( sizeof(DIJOYSTATE2), &(event->_js) );
if ( SUCCEEDED(hr) ) eventQueue->userEvent( event.get() );
}
}
示例5:
// Only for debug
void
ClefKeyContext::dumpKeyContext()
{
KeyMaps::iterator i;
KeyMap::iterator j;
std::cout << "Begin of key context dump =================" << std::endl;
for (i = m_keyMaps.begin(); i != m_keyMaps.end(); ++i) {
std::cout << " Track = " << (*i).first << std::endl;
KeyMap *m = (*i).second;
for (j = m->begin(); j != m->end(); ++j) {
std::cout << " Time = " << (*j).first
<< " Key = " << (*j).second.getName() << std::endl;
}
}
std::cout << "End of key context dump =================" << std::endl;
}