hid_listener

Last updated:

0 purchases

hid_listener Image
hid_listener Images
Add to Cart

Description:

hid listener

hid_listener #
HidListener is a library that allows you to listen to hid events cross-platform.
Windows #
Add this into your main.cpp file
#include <hid_listener/hid_listener_plugin_windows.h>
copied to clipboard
and add this inside wWinMain funciton
HidListener listener;
copied to clipboard
MacOS #
Add this into your MainFlutterWindow.swift file
import hid_listener
copied to clipboard
and add this inside MainFlutterWindow class
let listener = HidListener()
copied to clipboard
The file should now look something like this:
...
import hid_listener

class MainFlutterWindow: NSWindow {
let listener = HidListener()
...
copied to clipboard
Linux #
Add this into your main.cc file
#include <hid_listener/hid_listener_plugin.h>
copied to clipboard
and add this inside main funciton
HidListener listener;
copied to clipboard
Dart #
To use the library, you first have to initialize the listener backend:
if (getListenerBackend() != null) {
if (!getListenerBackend().initialize()) {
print("Failed to initialize listener backend");
}
} else {
print("No listener backend for this platform")
}
copied to clipboard
After successfully initializing the listener backend, register listeners like this:
final keyboardListenerId = getListenerBackend()!.addKeyboardListener((event) {
print("${event.logicalKey.debugName}")
});

getListenerBackend()!.addMouseListener((event) { ... })
copied to clipboard
Removing listeners can be done using remove(keyboard/Mouse)Listener method call:
getListenerBackend()!.removeKeyboardListener(keyboardListenerId);
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.