mirror of
https://github.com/google/mozc-devices.git
synced 2025-11-09 01:03:26 +03:00
29 lines
547 B
C++
29 lines
547 B
C++
#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);
|
|
};
|
|
|