Giter Club home page Giter Club logo

androidtrackpad's Introduction

Android Trackpad

Connect your Android phone to Windows or Linux system as a trackpad


How to use

Install PC side based on your system, install apk on your Android phone
For bluetooth mode, please pair phone with your PC in advance
For Wifi mode, please start a hotspot on PC and connect your phone with it (Or if your router support port forwarding, this program may also work for PC and Android in same network. The port is 10086)

Note

There are some issues with exiting the program (See Windows README.md for detail)
All are solvable by disconnecting from Android side first


Demo

This is a live demo on Linux laptop with Bluetooth connection
Demo


Features

  1. Connect via Wifi, or Bluetooth (Configuration done on both sides)
  2. Four basic actions:
    a. click (left & right)
    b. scroll (up-down & left-right)
    c. drag
    d. move
  3. Data pack design:
     enum DATA_TYPE
     {
         DATA_TYPE_CLICK_LEFT  = 0,
         DATA_TYPE_CLICK_RIGHT = 1,
         DATA_TYPE_SCROLL_HORI = 2,
         DATA_TYPE_SCROLL_VERT = 3,
         DATA_TYPE_DRAG        = 4,
         DATA_TYPE_MOVE        = 5,
     };
    
     struct DATA
     {
         enum DATA_TYPE type;
         float velX;
         float velY;
     };
    velX and velY are used as distance when type is a movement
  4. Trackpad sensitivity control

androidtrackpad's People

Contributors

teamclouday avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

androidtrackpad's Issues

make errors for imgui undefine references

/usr/bin/ld: libIMGUI_LIBRARIES.a(imgui.cpp.o): in function ImGuiListClipper_SeekCursorForItem(ImGuiListClipper*, int) [clone .isra.0]': imgui.cpp:(.text+0x976): undefined reference to ImGui::TableEndRow(ImGuiTable*)'
/usr/bin/ld: libIMGUI_LIBRARIES.a(imgui.cpp.o): in function ImGui::DebugTextEncoding(char const*) [clone .part.0]': imgui.cpp:(.text+0x52fb): undefined reference to ImGui::TableSetupColumn(char const*, int, float, unsigned int)'
/usr/bin/ld: imgui.cpp:(.text+0x530f): undefined reference to ImGui::TableSetupColumn(char const*, int, float, unsigned int)' /usr/bin/ld: imgui.cpp:(.text+0x5323): undefined reference to ImGui::TableSetupColumn(char const*, int, float, unsigned int)'
/usr/bin/ld: imgui.cpp:(.text+0x5337): undefined reference to ImGui::TableSetupColumn(char const*, int, float, unsigned int)' /usr/bin/ld: imgui.cpp:(.text+0x533c): undefined reference to ImGui::TableHeadersRow()'
/usr/bin/ld: imgui.cpp:(.text+0x536e): undefined reference to ImGui::TableNextColumn()' /usr/bin/ld: imgui.cpp:(.text+0x5386): undefined reference to ImGui::TableNextColumn()'
/usr/bin/ld: imgui.cpp:(.text+0x5421): undefined reference to ImGui::TableNextColumn()' /usr/bin/ld: imgui.cpp:(.text+0x5455): undefined reference to ImGui::TableNextColumn()'
/usr/bin/ld: libIMGUI_LIBRARIES.a(imgui.cpp.o): in function ImGuiListClipper::Begin(int, float)': imgui.cpp:(.text+0xac17): undefined reference to ImGui::TableEndRow(ImGuiTable*)'
/usr/bin/ld: libIMGUI_LIBRARIES.a(imgui.cpp.o): in function ImGui::Initialize()': imgui.cpp:(.text+0xb79e): undefined reference to ImGui::TableSettingsAddSettingsHandler()'
/usr/bin/ld: libIMGUI_LIBRARIES.a(imgui.cpp.o): in function ImGui::End()': imgui.cpp:(.text+0x138bc): undefined reference to ImGui::EndColumns()'
/usr/bin/ld: libIMGUI_LIBRARIES.a(imgui.cpp.o): in function ImGui::DebugTextEncoding(char const*)': imgui.cpp:(.text+0x15fa8): undefined reference to ImGui::BeginTable(char const*, int, int, ImVec2 const&, float)'
/usr/bin/ld: libIMGUI_LIBRARIES.a(imgui.cpp.o): in function ImGui::DebugNodeColumns(ImGuiOldColumns*)': imgui.cpp:(.text+0x16099): undefined reference to ImGui::GetColumnOffsetFromNorm(ImGuiOldColumns const*, float)'
/usr/bin/ld: libIMGUI_LIBRARIES.a(imgui.cpp.o): in function ImGui::ErrorCheckEndWindowRecover(void (*)(void*, char const*, ...), void*)': imgui.cpp:(.text+0x17303): undefined reference to ImGui::EndTable()'
/usr/bin/ld: libIMGUI_LIBRARIES.a(imgui.cpp.o): in function ImGui::NewFrame()': imgui.cpp:(.text+0x233db): undefined reference to ImGui::TableGcCompactTransientBuffers(ImGuiTable*)'
/usr/bin/ld: imgui.cpp:(.text+0x2344c): undefined reference to ImGui::TableGcCompactTransientBuffers(ImGuiTableTempData*)' /usr/bin/ld: imgui.cpp:(.text+0x23e90): undefined reference to ImGui::TableGcCompactSettings()'
/usr/bin/ld: libIMGUI_LIBRARIES.a(imgui.cpp.o): in function ImGui::ShowStackToolWindow(bool*)': imgui.cpp:(.text+0x26251): undefined reference to ImGui::BeginTable(char const*, int, int, ImVec2 const&, float)'
/usr/bin/ld: imgui.cpp:(.text+0x26289): undefined reference to ImGui::TableSetupColumn(char const*, int, float, unsigned int)' /usr/bin/ld: imgui.cpp:(.text+0x262a0): undefined reference to ImGui::TableSetupColumn(char const*, int, float, unsigned int)'
/usr/bin/ld: imgui.cpp:(.text+0x262bb): undefined reference to ImGui::TableSetupColumn(char const*, int, float, unsigned int)' /usr/bin/ld: imgui.cpp:(.text+0x262c0): undefined reference to ImGui::TableHeadersRow()'
/usr/bin/ld: imgui.cpp:(.text+0x262f7): undefined reference to ImGui::TableNextColumn()' /usr/bin/ld: imgui.cpp:(.text+0x26323): undefined reference to ImGui::TableNextColumn()'
/usr/bin/ld: imgui.cpp:(.text+0x26354): undefined reference to ImGui::TableNextColumn()' /usr/bin/ld: imgui.cpp:(.text+0x263bb): undefined reference to ImGui::TableSetBgColor(int, unsigned int, int)'
/usr/bin/ld: imgui.cpp:(.text+0x263e1): undefined reference to ImGui::EndTable()' /usr/bin/ld: libIMGUI_LIBRARIES.a(imgui.cpp.o): in function ImGuiListClipper::Step()':
imgui.cpp:(.text+0x26f6c): undefined reference to ImGui::TableEndRow(ImGuiTable*)' /usr/bin/ld: libIMGUI_LIBRARIES.a(imgui.cpp.o): in function ImGui::ShowMetricsWindow(bool*)':
imgui.cpp:(.text+0x291e2): undefined reference to ImGui::DebugNodeTable(ImGuiTable*)' /usr/bin/ld: imgui.cpp:(.text+0x2a294): undefined reference to ImGui::DebugNodeTableSettings(ImGuiTableSettings*)'
/usr/bin/ld: imgui.cpp:(.text+0x2af12): undefined reference to ImGui::BeginTable(char const*, int, int, ImVec2 const&, float)' /usr/bin/ld: libIMGUI_LIBRARIES.a(imgui.cpp.o): in function ImGui::DebugTextEncoding(char const*) [clone .part.0]':
imgui.cpp:(.text+0x54c7): undefined reference to ImGui::EndTable()' /usr/bin/ld: libIMGUI_LIBRARIES.a(imgui.cpp.o): in function ImGui::GcCompactTransientMiscBuffers()':
imgui.cpp:(.text+0xa2a2): undefined reference to ImGui::TableGcCompactSettings()' /usr/bin/ld: libIMGUI_LIBRARIES.a(imgui_widgets.cpp.o): in function ImGui::SeparatorEx(int)':
imgui_widgets.cpp:(.text+0x8543): undefined reference to ImGui::PushColumnsBackground()' /usr/bin/ld: imgui_widgets.cpp:(.text+0x85b4): undefined reference to ImGui::PopColumnsBackground()'
/usr/bin/ld: libIMGUI_LIBRARIES.a(imgui_widgets.cpp.o): in function ImGui::Selectable(char const*, bool, int, ImVec2 const&)': imgui_widgets.cpp:(.text+0x11f9d): undefined reference to ImGui::PushColumnsBackground()'
/usr/bin/ld: imgui_widgets.cpp:(.text+0x120f2): undefined reference to ImGui::PopColumnsBackground()' /usr/bin/ld: imgui_widgets.cpp:(.text+0x12320): undefined reference to ImGui::TablePushBackgroundChannel()'
/usr/bin/ld: imgui_widgets.cpp:(.text+0x12340): undefined reference to `ImGui::TablePopBackgroundChannel()'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/TrackpadService.dir/build.make:189: ../bin/Release/TrackpadService] Error 1
make[1]: *** [CMakeFiles/Makefile2:111: CMakeFiles/TrackpadService.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Bluez 5

Found a bluez-rfcomm-example repo for Bluez 5 rfcomm server/client example. Whoever created the repo is a hero!!!
Only concern is that Bluez 5 may also require root permission for registration, not sure if there is a way around it.

For me in the future: read and try to implement for linux version.

Also might be worthwhile to update the repo (i.e. a complete refactor of PC code). I would prefer to compile either platform in single cmake file and share most of the code.
And ofc, update the UI as well ๐Ÿค—

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.