
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
JavaScript library to use a device with a gyroscope (like every smartphone from the last few years) as a pointing device for a screen.
The library consists of two parts: GymoteRemote and GymoteScreen, with the idea that both run on different devices.
It's built around the idea that a WebRTC or WebSocket connection is used to send data. To keep latency as low as possible, data ist sent as an ArrayBuffer.
The remote reads out the values of the gyroscope, calculate where the device is pointing at and return the x and y coordinates on the screen. For this to work, it needs to be aware of these two values:
You need to somehow pass this information to the remote whenever it changes.
In addition, the remote supports clicking and touch events, but again you have to update the state yourself, by having a button, attach event listeners to it and so on.
Once all is wired up you need to send the remote data to the screen whenever it changes. The remote doesn't emit an event for that, you have to pass a function which will received the data as the first argument. In there you send the data via your WebRTC or WebSocket connection.
Starting with iOS 12.2 accessing device motion data (like gyroscope) requires permission from the user. As of September 2019 there is no way to check if permission has been granted, so the best bet is to ask for permission on every page load.
The "receiving" end is mostly responsible for emitting events based on the incoming remote data. The data (ArrayBuffer) is passed to the handleRemoteData function. Common events like pointerdown, pointermove or touch are emitted, so it should be easy to integrate in various setups.
Gymote was built with low latency and performance in mind. But for achieving the best results the data needs to be transmitted from the remote to the screen in the shortes amount of time possible.
Peersox was built with exactly this in mind, providing a client and server to pair two devices and send data via WebRTC data channels, with WebSocket for signaling and fallback.
FAQs
Use your phone as a remote pointing device on a computer
We found that gymote demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.