Commit 8b5734db authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Use runwithplugin

parent d3beb45b
...@@ -104,12 +104,7 @@ public class KeyListenerView extends View { ...@@ -104,12 +104,7 @@ public class KeyListenerView extends View {
} }
private void sendKeyPressPacket(final NetworkPacket np) { private void sendKeyPressPacket(final NetworkPacket np) {
BackgroundService.RunCommand(getContext(), service -> { BackgroundService.RunWithPlugin(getContext(), deviceId, MousePadPlugin.class, plugin -> plugin.sendKeyboardPacket(np));
Device device = service.getDevice(deviceId);
MousePadPlugin mousePadPlugin = device.getPlugin(MousePadPlugin.class);
if (mousePadPlugin == null) return;
mousePadPlugin.sendKeyboardPacket(np);
});
} }
@Override @Override
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment