From e9cc5756dbb0a2d079a7b5e3438d79945f819df5 Mon Sep 17 00:00:00 2001 From: BossCode45 Date: Sat, 3 Jun 2023 21:30:05 +1200 Subject: feat: Keybind updates Re added the ability to swap super and mod as a config parameter (the ~swapmods~) command). Finally fixed keybinds sometimes not working because of numlock, bitwise & with the modifiers I actually care about. --- commands.cpp | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'commands.cpp') diff --git a/commands.cpp b/commands.cpp index 09bdf62..c41536d 100644 --- a/commands.cpp +++ b/commands.cpp @@ -12,30 +12,15 @@ using std::cout, std::endl, std::string, std::vector, std::tolower; -const void CommandsModule::printHello(const CommandArg* argv) -{ - cout << "Hello" << endl; -} - -const void CommandsModule::echo(const CommandArg* argv) -{ - cout << "Echo: '" << argv[0].str << '\'' << endl; -} - CommandsModule::CommandsModule() { - addCommand("printHello", &CommandsModule::printHello, 0, {}, this); - CommandArgType* args0 = new CommandArgType[1]; - args0[0] = STR_REST; - addCommand("echo", &CommandsModule::echo, 1, args0, this); } CommandsModule::~CommandsModule() { for(Command c : commandList) { - // This is probably needed but its not working - //if(c.argc > 0) - //delete[] c.argTypes; + if(c.argc > 0) + delete[] c.argTypes; } } @@ -150,7 +135,6 @@ CommandArg* CommandsModule::getCommandArgs(vector& split, const CommandA void CommandsModule::runCommand(string command) { - cout << command << endl; vector split = splitCommand(command); Command* cmd = lookupCommand(split[0]); if(cmd == nullptr) -- cgit v1.2.3