Showing the changes to interface/src/scripting/KeyboardScriptingInterface.cpp (1 of 7 files). Show all
Unified · Split
| @@ -9,6 +9,7 @@ · 8 unmodified lines | ||
| 9 | 9 | // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html |
| 10 | 10 | // |
| 11 | 11 | |
| 12 | +#include "ScriptPermissions.h" | |
| 12 | 13 | #include "KeyboardScriptingInterface.h" |
| 13 | 14 | #include "ui/Keyboard.h" |
| 14 | 15 | |
| @@ -67,3 +68,11 @@ bool KeyboardScriptingInterface::getPreferMalletsOverLasers() const { · 52 unmodified lines | ||
| 67 | 68 | bool KeyboardScriptingInterface::containsID(const QUuid& id) const { |
| 68 | 69 | return DependencyManager::get<Keyboard>()->containsID(id); |
| 69 | 70 | } |
| 71 | + | |
| 72 | +void KeyboardScriptingInterface::emitKeyEvent(const KeyEvent& event, bool pressed) const { | |
| 73 | + if (!ScriptPermissions::isCurrentScriptAllowed(ScriptPermissions::Permission::SCRIPT_PERMISSION_KEYBOARD_EVENTS)) { | |
| 74 | + return; | |
| 75 | + } | |
| 76 | + | |
| 77 | + DependencyManager::get<Keyboard>()->emitKeyEvent(event, pressed); | |
| 78 | +} | |