MacBook: Private API measures display angle – and plays music
The MacBook knows where the screen is: Apple detects this using sensors. A developer has now found the hidden API for this.
Partially opened MacBook: The angle can be read.
(Image: WeDesing / Shutterstock.com)
Not all sensors in the Mac are obvious: current MacBooks have a so-called Lid Angle Sensor, which can determine the angle at which the display lid is upright. This is used for sleep mode, for example, but the API available for this is not accessible to developers. Developer Sam Gold has now changed this with an open source project: On GitHub, he provides the code that makes it possible to read out the data.
Caution, flexible cable!
So far, the applications are mainly a gimmick: Gold shows on Bluesky how he can emulate a squeaky door and build a virtual theremin (see Wikipedia). Gold has also published the code for the "Theremin Mode". However, users should be aware that the flex cable bundle that connects the screen to the motherboard can be cracked or even broken if you "play" too hard. "Don't do this too often or you'll end up with a broken flex cable," writes one Bluesky user. "It's worth the risk," Gold replies humorously.
Videos by heise
Incidentally, such tinkering with hardware sensors on Macs is nothing new. At one time, there were apps that read the integrated acceleration sensor (Sudden Motion Sensor, SMS), which was actually used for hard disk protection – and turned it into a Lightsaber "game". Here, too, it was important not to overdo it. Another user commented that he had tried this for about 10 seconds before he realized that he was swinging a 1500 US dollar laptop around.
Apple Silicon machines creak along
The Lid Angle Sensor API currently works with Apple Silicon MacBooks. It was tested with an M4 model, but it should also work with M2 and M3. According to Gold, however, there are difficulties with M1 devices – why is still unclear.
Apple introduced the current sensor in the 16-inch MacBook Pro in 2019. MacBook Air machines with Apple Silicon (from M2) also work with the software. Interesting fact: If you install the sensor as a spare part (e.g. from an old device), it must be calibrated. This was a real problem for independent repair stores for a long time.
Empfohlener redaktioneller Inhalt
Mit Ihrer Zustimmung wird hier ein externer Preisvergleich (heise Preisvergleich) geladen.
Ich bin damit einverstanden, dass mir externe Inhalte angezeigt werden. Damit können personenbezogene Daten an Drittplattformen (heise Preisvergleich) übermittelt werden. Mehr dazu in unserer Datenschutzerklärung.
(bsc)