2020-10-02 06:44:05 +00:00
|
|
|
#include "flipper.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
static void state_cb(const void* value, size_t size, void* ctx) {
|
|
|
|
const InputState* state = value;
|
|
|
|
|
|
|
|
printf("state: %02x\n", *state);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void event_cb(const void* value, size_t size, void* ctx) {
|
|
|
|
const InputEvent* event = value;
|
|
|
|
|
|
|
|
printf("event: %02x %s\n", event->input, event->state ? "pressed" : "released");
|
|
|
|
}
|
|
|
|
|
|
|
|
void application_input_dump(void* p) {
|
|
|
|
// open record
|
|
|
|
FuriRecordSubscriber* state_record =
|
2020-10-13 08:22:43 +00:00
|
|
|
furi_open_deprecated("input_state", false, false, state_cb, NULL, NULL);
|
2020-10-02 06:44:05 +00:00
|
|
|
FuriRecordSubscriber* event_record =
|
2020-10-13 08:22:43 +00:00
|
|
|
furi_open_deprecated("input_events", false, false, event_cb, NULL, NULL);
|
2020-10-02 06:44:05 +00:00
|
|
|
|
|
|
|
for(;;) {
|
|
|
|
delay(100);
|
|
|
|
}
|
|
|
|
}
|