Giter Club home page Giter Club logo

Comments (10)

albinekb avatar albinekb commented on May 21, 2024 6

Please don't make a keylogger @JafarAkhondali 😂

from proton-native.

JafarAkhondali avatar JafarAkhondali commented on May 21, 2024

@albinekb LOL 😅 Who would create a keyloggger in 2018 using react? 😺
I've developed a client for an device using tcp sockets() and electron, But sometimes we need to minimize the window of our application and have the same functionality

from proton-native.

espoal avatar espoal commented on May 21, 2024

I was thinking the same... maybe we need to use a nodejs server for system calls?

for example file system could be exposed through a graphql request?

from proton-native.

kusti8 avatar kusti8 commented on May 21, 2024

That wouldn't be part of this package, but another. I'm not familiar with doing this in node so I wouldn't know.

from proton-native.

parro-it avatar parro-it commented on May 21, 2024

Hi @kusti8, I'm libui-node author. I gave a look at how you implemented the event loop here: https://github.com/kusti8/proton-native/blob/master/src/eventLoop.js

It's similar to how the event loop of libui-node works in early release. As far as I can say, node calls should work just fine (but I didn't try yet).

And system calls like logging keys should work too... You could try to use my https://github.com/parro-it/screen-info and see if it work.

Anyway these event loop implementation is highly CPU intensive, because it is based on polling (~4% CPU on an inactive, simple window).

In later libui-node versions, I implemented a background thread version of some part of the loop that is way more performant, but is actually not working on macOS.

And I was not able to find a way to make the same trick work on Windows, that is still using the poor performance polling.

from proton-native.

kusti8 avatar kusti8 commented on May 21, 2024

from proton-native.

parro-it avatar parro-it commented on May 21, 2024

Yeah I implemented it after I released it because of the macOS error.

I'm thinking of restoring an old version for macOS that should work on last os versions, but involve the use of the an internal, undocumented call _dispatch_get_main_queue_port_4CF.

I have no solution for Windows yet... but we discussed on libui repos in 2016 and it seems there could be a possible solution.

Node callbacks should work since it's just an event loop, and it calls refresh on the same
thread.

I agree.

from proton-native.

parro-it avatar parro-it commented on May 21, 2024

I saw only around .4% CPU utilization but I don't know how it is
for others.

I think libui, libui-node and proton-native are attractive because they are lite-weight alternative to electron, and so they probably they will be used more often on low-range CPU, where, sadly, the polling-penalty is more heavy.

from proton-native.

kusti8 avatar kusti8 commented on May 21, 2024

Yeah I understand. I don't know enough to work out a cross platform event loop. I would love something that uses native threads, but it's obviously hard to work out.

from proton-native.

kusti8 avatar kusti8 commented on May 21, 2024

I'm closing it as it seems that the OP question has been answered. @parro-it feel free to create a separate issue to track this closer.

from proton-native.

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.