mirror of
https://github.com/google/mozc-devices.git
synced 2025-11-09 01:03:26 +03:00
Initial upload of the Physical Flick keyboard files.
This commit is contained in:
28
mozc-furikku/arduino/flick/flick_keyboard.h
Normal file
28
mozc-furikku/arduino/flick/flick_keyboard.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define ROWS 5
|
||||
#define COLS 12 // Equals to the number of the keys.
|
||||
|
||||
enum Direction {
|
||||
CENTER, LEFT, UP, RIGHT, DOWN, NONE
|
||||
};
|
||||
|
||||
struct SensorData {
|
||||
uint16_t axes[COLS * 2];
|
||||
bool button[COLS];
|
||||
};
|
||||
|
||||
class FlickKeyboard {
|
||||
private:
|
||||
Direction lastState[COLS];
|
||||
Direction ConvertToFlickState(int16_t x, int16_t y,
|
||||
bool buttonPressed);
|
||||
public:
|
||||
FlickKeyboard();
|
||||
void ProcessSensorData(const SensorData& data, size_t maxKeyNum,
|
||||
const char** outputStrings, int* nOutputs);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user