|
|
@ -27,14 +27,15 @@ namespace samsung { |
|
|
|
static constexpr const char* kGeasturePath = "/sys/class/sec/sec_epen/epen_gestures"; |
|
|
|
static constexpr const char* kGeasturePath = "/sys/class/sec/sec_epen/epen_gestures"; |
|
|
|
|
|
|
|
|
|
|
|
const std::map<int32_t, TouchscreenGesture::GestureInfo> TouchscreenGesture::kGestureInfoMap = { |
|
|
|
const std::map<int32_t, TouchscreenGesture::GestureInfo> TouchscreenGesture::kGestureInfoMap = { |
|
|
|
|
|
|
|
// clang-format off
|
|
|
|
{0, {0x2f1, "Swipe up stylus"}}, |
|
|
|
{0, {0x2f1, "Swipe up stylus"}}, |
|
|
|
{1, {0x2f2, "Swipe down stylus"}}, |
|
|
|
{1, {0x2f2, "Swipe down stylus"}}, |
|
|
|
{2, {0x2f3, "Swipe left stylus"}}, |
|
|
|
{2, {0x2f3, "Swipe left stylus"}}, |
|
|
|
{3, {0x2f4, "Swipe right stylus"}}, |
|
|
|
{3, {0x2f4, "Swipe right stylus"}}, |
|
|
|
{4, {0x2f5, "Long press stylus"}}, |
|
|
|
{4, {0x2f5, "Long press stylus"}}, |
|
|
|
|
|
|
|
// clang-format on
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool TouchscreenGesture::isSupported() { |
|
|
|
bool TouchscreenGesture::isSupported() { |
|
|
|
std::ifstream file(kGeasturePath); |
|
|
|
std::ifstream file(kGeasturePath); |
|
|
|
return file.good(); |
|
|
|
return file.good(); |
|
|
@ -57,7 +58,7 @@ Return<bool> TouchscreenGesture::setGestureEnabled( |
|
|
|
std::fstream file(kGeasturePath); |
|
|
|
std::fstream file(kGeasturePath); |
|
|
|
int gestureMode; |
|
|
|
int gestureMode; |
|
|
|
int mask = 1 << gesture.id; |
|
|
|
int mask = 1 << gesture.id; |
|
|
|
|
|
|
|
|
|
|
|
file >> gestureMode; |
|
|
|
file >> gestureMode; |
|
|
|
|
|
|
|
|
|
|
|
if (enabled) |
|
|
|
if (enabled) |
|
|
@ -70,7 +71,6 @@ Return<bool> TouchscreenGesture::setGestureEnabled( |
|
|
|
return !file.fail(); |
|
|
|
return !file.fail(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Methods from ::android::hidl::base::V1_0::IBase follow.
|
|
|
|
// Methods from ::android::hidl::base::V1_0::IBase follow.
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace samsung
|
|
|
|
} // namespace samsung
|
|
|
|