On my Thinkpad T580 laptop, the Fn+F5 and Fn+F6 shortcut keys manually control screen brightness. These shortcuts function as expected with KDE and Xfce but not TDE. No special configuration is needed.
I find nothing that helps in kcontrol or tdepowersave. I found a thread in this list discussing the issue but with no simple solution.
What is needed to have TDE support these shortcuts to "just work" like with KDE and Xfce?
Thanks.
On 11/27/24 2:53 PM, Darrell Anderson via tde-users wrote:
On my Thinkpad T580 laptop, the Fn+F5 and Fn+F6 shortcut keys manually control screen brightness. These shortcuts function as expected with KDE and Xfce but not TDE. No special configuration is needed.
I find nothing that helps in kcontrol or tdepowersave. I found a thread in this list discussing the issue but with no simple solution.
What is needed to have TDE support these shortcuts to "just work" like with KDE and Xfce?
What distro?
I assume you have kmilo-trinity installed. Did you try kmilo-legacy-trinity?
On 11/27/24 5:37 PM, deloptes via tde-users wrote:
Darrell Anderson via tde-users wrote:
What is needed to have TDE support these shortcuts to "just work" like with KDE and Xfce?
I think you may need kmilo-trinity
That helped some. Looks like the problem is incomplete support for the T580 model. On my T400 Thinkpad the brightness keys are Fn+Home|End. On the T580 the keys are Fn+F5|F6. The brightness keys on the T400 function fine.
Some special keys on the T580 function, such as sound volume and suspend to ram.
I browsed the tdeutils/kmilo code but did not find anything obvious with how Fn keys are mapped or detected on Thinkpads.
On Thu, 28 Nov 2024 13:22:30 -0600 Darrell Anderson via tde-users users@trinitydesktop.org wrote:
I browsed the tdeutils/kmilo code but did not find anything obvious with how Fn keys are mapped or detected on Thinkpads.
If I'm reading the code correctly, it isn't detecting your key presses per se at all.
If you fish through the READMEs, it looks like kmilo's Thinkpad support was at least in part carried over from an application called tpb ( http://www.nongnu.org/tpb/ ), whose developers reverse-engineered what the extended keys were doing by observing nvram. kmilo seems to be using offsets and bitmasks hard-coded into the ThinkPadMonitor::getNvramState function in kmilo/thinkpad/thinkpad.cpp to determine what the nvram contents mean.
I think there are instructions somewhere on the tpb site for monitoring nvram. That seems to be what you would have to do to derive a new set of magic numbers that work with your T580.
It's a weird and brittle system, and to be honest, I'm surprised it works at all on modern hardware.
E. Liddell
Anno domini 2024 Thu, 28 Nov 15:25:35 -0500 E. Liddell via tde-users scripsit:
On Thu, 28 Nov 2024 13:22:30 -0600 Darrell Anderson via tde-users users@trinitydesktop.org wrote:
I browsed the tdeutils/kmilo code but did not find anything obvious with how Fn keys are mapped or detected on Thinkpads.
If I'm reading the code correctly, it isn't detecting your key presses per se at all.
If you fish through the READMEs, it looks like kmilo's Thinkpad support was at least in part carried over from an application called tpb ( http://www.nongnu.org/tpb/ ), whose developers reverse-engineered what the extended keys were doing by observing nvram. kmilo seems to be using offsets and bitmasks hard-coded into the ThinkPadMonitor::getNvramState function in kmilo/thinkpad/thinkpad.cpp to determine what the nvram contents mean.
I think there are instructions somewhere on the tpb site for monitoring nvram. That seems to be what you would have to do to derive a new set of magic numbers that work with your T580.
It's a weird and brittle system, and to be honest, I'm surprised it works at all on modern hardware.
It's not that bad. The brightness keys are handled by ACPI, so when you have installed acpid you can just run
$ acpi_listen
and the you get something like:
video/brightnessdown BRTDN 00000087 00000000 video/brightnessdown BRTDN 00000087 00000000 video/brightnessup BRTUP 00000086 00000000 video/brightnessup BRTUP 00000086 00000000 video/brightnessup BRTUP 00000086 00000000
... hm ... mybe you are missing acpid?
Nik
E. Liddell ____________________________________________________ tde-users mailing list -- users@trinitydesktop.org To unsubscribe send an email to users-leave@trinitydesktop.org Web mail archive available at https://mail.trinitydesktop.org/mailman3/hyperkitty/list/users@trinitydeskto...
-- Please do not email me anything that you are not comfortable also sharing with the NSA, CIA ...
On 11/28/24 2:46 PM, Dr. Nikolaus Klepp via tde-users wrote:
It's not that bad. The brightness keys are handled by ACPI, so when you have installed acpid you can just run
$ acpi_listen
and the you get something like:
video/brightnessdown BRTDN 00000087 00000000 video/brightnessdown BRTDN 00000087 00000000 video/brightnessup BRTUP 00000086 00000000 video/brightnessup BRTUP 00000086 00000000 video/brightnessup BRTUP 00000086 00000000
... hm ... mybe you are missing acpid?
The acpi daemon is installed and running, but the proverbial plot thickens.
The T580 Fn+F5|F6 keys return:
video/brightnessup BRTUP 00000086 00000000 video/brightnessdown BRTDN 00000087 00000000
The T400 Fn+Home|End keys return:
video/brightnessup BRTUP 00000086 00000000 video/brightnessdown BRTDN 00000087 00000000
Seems the mapping is the same on both laptops. Yet the T580 keys fail with TDE.
On 2024/11/29 06:30 AM, Darrell Anderson via tde-users wrote:
Seems the mapping is the same on both laptops. Yet the T580 keys fail with TDE.
Hi Darrell, simple (dumb) question: is kmilo service "running"? it can be started/stopped from the service manager, so worth checking if it is not running on one of the desktops. Cheers Michele
On 11/28/24 2:25 PM, E. Liddell via tde-users wrote:
On Thu, 28 Nov 2024 13:22:30 -0600 Darrell Anderson via tde-users users@trinitydesktop.org wrote:
I browsed the tdeutils/kmilo code but did not find anything obvious with how Fn keys are mapped or detected on Thinkpads.
If I'm reading the code correctly, it isn't detecting your key presses per se at all.
If you fish through the READMEs, it looks like kmilo's Thinkpad support was at least in part carried over from an application called tpb ( http://www.nongnu.org/tpb/ ), whose developers reverse-engineered what the extended keys were doing by observing nvram. kmilo seems to be using offsets and bitmasks hard-coded into the ThinkPadMonitor::getNvramState function in kmilo/thinkpad/thinkpad.cpp to determine what the nvram contents mean.
I think there are instructions somewhere on the tpb site for monitoring nvram. That seems to be what you would have to do to derive a new set of magic numbers that work with your T580.
It's a weird and brittle system, and to be honest, I'm surprised it works at all on modern hardware.
I looked at kmilo/thinkpad/README. As mentioned, the text implies that Thinkpad special key mappings are stored in the hardware nvram, of which the /dev/nvram device node is used to read the contents.
On my (Slackware) system the default permissions for /dev/nvram is 0600. TDE kmilo/thinkpad code is designed to expect full read permissions and prefers write permissions for certain functions. Yet these expectations do not seem required for KDE or Xfce. My wild guess is those read/write limitations should be removed from TDE code.
TDE reads some T580 special keys correctly but not the brightness keys and reads the T400 brightness keys just fine. My guess is the hardcoding method in kmilo/thinkpad/thinkpad.cpp (thinkpad_state->brightness_level and thinkpad_state->brightness_toggle) is presuming only the old style Thinkpad key mappings of Fn+Home|End.
I'm guessing with KDE and Xfce the code interrogates nvram to discover the mappings. The old way used in TDE code doesn't do this.
A paper cut bug but most of us know the old proverb about paper cuts. :(
On Thu, 28 Nov 2024 15:15:01 -0600 Darrell Anderson via tde-users users@trinitydesktop.org wrote:
I'm guessing with KDE and Xfce the code interrogates nvram to discover the mappings. The old way used in TDE code doesn't do this.
Actually, my bet would be that the other DEs are using something like the ACPI monitoring method Nik suggested. To my eye, the code here has all the hallmarks of a hack that was put in because, in 2004, better methods either didn't exist or couldn't be guaranteed to work on most hardware (since devices from the 1990s that didn't support ACPI were still in use).
A commit message from the KDE repository in 2008 notes:
"removing to unmaintained/4: ksim, kmilo, klaptopdaemon
Noone has been interested to care for this codebase for some time, a public call for maintainer did not change this."
Thereafter, kmilo doesn't appear in the tree for any KDE release milestone. They probably rewrote their support for extended laptop keys from scratch.
E. Liddell