这篇教程C++ AddCommand函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AddCommand函数的典型用法代码示例。如果您正苦于以下问题:C++ AddCommand函数的具体用法?C++ AddCommand怎么用?C++ AddCommand使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了AddCommand函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: ModuleBase ModuleInput::ModuleInput() : ModuleBase("Input") { VarInputRawInput = AddVariableInt("RawInput", "rawinput", "Enables raw mouse input with no acceleration applied", eCommandFlagsArchived, 1, VariableInputRawInputUpdate); VarInputRawInput->ValueIntMin = 0; VarInputRawInput->ValueIntMax = 1; AddCommand("Bind", "bind", "Binds a command to a key", eCommandFlagsNone, CommandBind, { "key", "[+]command", "arguments" }); Patches::Input::RegisterDefaultInputHandler(KeyboardUpdated); AddCommand("UIButtonPress", "ui_btn_press", "Emulates a gamepad button press on UI menus", eCommandFlagsNone, CommandUIButtonPress, { "btnCode The code of the button to press" }); CommandBindControllerAction = AddCommand("ControllerAction", "controller", "Binds an in-game action to a controller button", eCommandFlagsNone, ::CommandBindControllerAction, { "action The name of the action to bind", "button The button name" }); CommandBindKeyboardAction = AddCommand("KeyboardAction", "keyboard", "Binds an in-game action to keyboard keys or mouse buttons", eCommandFlagsNone, ::CommandBindKeyboardAction, { "action The name of the action to bind", "[primary] The primary key name", "[secondary] The secondary key name" });#ifdef _DEBUG AddCommand("DebugBindings", "debugbindings", "Dumps the input bindings table", eCommandFlagsNone, CommandDumpBindings);#endif VarControllerSensitivityX = AddVariableFloat("ControllerSensitivityX", "xsens", "Horizontal controller look sensitivity", eCommandFlagsArchived, 120, VariableControllerSensitivityXUpdated); VarControllerSensitivityY = AddVariableFloat("ControllerSensitivityY", "ysens", "Vertical controller look sensitivity", eCommandFlagsArchived, 60, VariableControllerSensitivityYUpdated); LoadDefaultBindings(); BuildSettingsMenu(); // Default command bindings (TODO: port bind saving code from recode) commandBindings[eKeyCodeA].command = { "ui_btn_press", "0" }; // A commandBindings[eKeyCodeB].command = { "ui_btn_press", "1" }; // B commandBindings[eKeyCodeEnd].command = { "ui_btn_press", "1" }; // B commandBindings[eKeyCodeHome].command = { "ui_btn_press", "2" }; // X }
开发者ID:RabidSquabbit,项目名称:ElDorito,代码行数:30,
示例2: InitializePlugin// Called once, when the plugin is to initializePLUGIN_API VOID InitializePlugin(VOID){ bzsrchhandle = CreateMutex(NULL, FALSE, NULL); DebugSpewAlways("Initializing MQ2Bzsrch"); LoadMQ2Plugin("MQ2ItemDisplay"); HMODULE h = LoadLibrary("MQ2ItemDisplay.dll"); if (!h) { pg_Item = NULL; } else { pg_Item = (ITEMINFO *)GetProcAddress(h, "g_Item"); } FreeLibrary(h); // Add commands, macro parameters, hooks, etc. AddCommand("/bzsrch",BzSrchMe); AddCommand("/breset",BzSrchMe); AddCommand("/mq2bzsrch",MQ2BzSrch); //AddCommand("/pricecheck",bzpc); AddMQ2Data("Bazaar",dataBazaar); // cc - added, but not using TLO yet EzDetour(CBazaarSearchWnd__HandleBazaarMsg,&BzSrchHook::BzDetour,&BzSrchHook::BzTrampoline); pBazaarType = new MQ2BazaarType; pBazaarItemType = new MQ2BazaarItemType;}
开发者ID:TheTypoMaster,项目名称:macroquest2,代码行数:27,
示例3: InitPluginint InitPlugin(void){ if(Inited == TRUE) return FALSE; Inited = TRUE; AddCommand("info", Command_Info); AddCommand("tileinfo", Command_TileInfo); /* not quite sure if this is needed */ /* InitCommonControls(); */ LayersWnd = CreateDialog(DLLInst, MAKEINTRESOURCE(DIALOG_LAYERINFO), GetMainTabWindow(), (DLGPROC)LayersDlgProc); PlayersWnd = CreateDialog(DLLInst, MAKEINTRESOURCE(DIALOG_PLAYERINFO), GetMainTabWindow(), (DLGPROC)PlayersDlgProc); if(LayersWnd == NULL || PlayersWnd == NULL) MBOut("INFO PLUGIN", "Could not create the dialog"); else { AddTab(LayersWnd, "Layers", FALSE); AddTab(PlayersWnd, "Players", FALSE); } return TRUE;}
开发者ID:byterj,项目名称:IRW_1.4,代码行数:25,
示例4: mbInCapturePlayer//--------------------------------------------------------------------------/// Default constructor for NextGenLayerManager.//--------------------------------------------------------------------------ModernAPILayerManager::ModernAPILayerManager() : mbInCapturePlayer(false), mbTraceTriggeredFromKeypress(false), m_captureType(CaptureType_LinkedTrace), m_captureCount(1){ // Command that collects a CPU and GPU trace from the same frame. AddCommand(CONTENT_TEXT, "FrameCaptureWithSave", "FrameCaptureWithSave", "FrameCaptureWithSave", NO_DISPLAY, NO_INCLUDE, mCmdFrameCaptureWithSave); // Command to set the session name AddCommand(CONTENT_TEXT, "SetSessionName", "SetSessionName", "SetSessionName.txt", DISPLAY, INCLUDE, mCmdSetSessionName); mCmdSetSessionName.SetEditableContentAutoReply(false); // Command to set the project name AddCommand(CONTENT_TEXT, "SetProjectName", "SetProjectName", "SetProjectName.txt", DISPLAY, INCLUDE, mCmdSetProjectName); mCmdSetProjectName.SetEditableContentAutoReply(false);#if ENABLE_TRACE_ON_KEYPRESS // Bind the keyboard's keypress callback to our virtual "OnKeyPressed" function. We can override if wherever we need to use it. std::function<void(int, WPARAM, LPARAM)> onKeyPressedHandler = std::bind(&ModernAPILayerManager::OnKeyPressed, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); osKeyboardListener::Instance().SetOnKbPressedCallback(onKeyPressedHandler);#endif // ENABLE_TRACE_ON_KEYPRESS}
开发者ID:imace,项目名称:CodeXL,代码行数:28,
示例5: openDoors DllExclusive void FactoryCommandSupplier::AddCommandsToUnit(Unit* unit) { auto commands = unit->GetCommands(); FactoryOpenDoorsCommand* openDoors(xNew1(FactoryOpenDoorsCommand, unit)); FactoryCloseDoorsCommand* closeDoors(xNew1(FactoryCloseDoorsCommand, unit)); commands->AddCommand(GetTypeId<FactoryOpenDoorsCommand>(), openDoors, 0); commands->AddCommand(GetTypeId<FactoryCloseDoorsCommand>(), closeDoors, 0); }
开发者ID:KFlaga,项目名称:FlagRTS,代码行数:8,
示例6: InitApplication// Init this application. Register your// commands, reactors...void InitApplication(){ // NOTE: DO NOT edit the following lines. //{{AFX_ARX_INIT AddCommand("ASDK", "BLOCKVIEW", "BVIEW", ACRX_CMD_MODAL, AsdkBlockView); AddCommand("ASDK", "CONFIGGS", "CONFIGGS", ACRX_CMD_TRANSPARENT | ACRX_CMD_USEPICKSET, AsdkConfigGS); //}}AFX_ARX_INIT}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:10,
|