Giter Club home page Giter Club logo

Comments (5)

br-lemes avatar br-lemes commented on June 22, 2024 1

Yes, it works. I'm typing using the PR version right now!

It's great!

from kanata.

jtroo avatar jtroo commented on June 22, 2024

That's a cool use case, thanks for sharing it! 👍

from kanata.

jtroo avatar jtroo commented on June 22, 2024

You've probably found this already, but for reference, the input reading is done in:
https://github.com/jtroo/kanata/blob/main/src/oskbd/linux.rs

Currently, the event loop does blocking calls to fetch_events for a single device, so would need to rearchitect the input event handling to be able to handle multiple devices. It would be good to dig into evsieve's source as inspiration for how they do it.


Edit:

Browsing through evsieve's source, it uses C style code using epoll and raw file descriptors. Quite efficient, but a lot more complicated than what kanata's doing.

from kanata.

jtroo avatar jtroo commented on June 22, 2024

I've added a kanata-evsieve crate exposing the evsieve functionality as a library. Not sure yet if using it is a viable strategy, but seems like it should work out okay.

from kanata.

jtroo avatar jtroo commented on June 22, 2024

@br-lemes please test the code in the new PR at your leisure. I haven't actually tested it on multiple keyboards myself since I don't have a convenient way to do so, but I think it should work.

Config change:

  ;; If you want to read from multiple devices, separate them by `:`.
  ;; linux-dev /dev/input/<dev1>:/dev/input/<dev2>

from kanata.

Related Issues (20)

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.