1

I have a python script which presses FN + RightArrow and so on to control the special brightness/volume functions.

I do not know the HEX code for the FN button. I tried 255 but it does not seem to be ok.

I've tried to determine it with KeyView.exe. It provides the HEX code for the pressed keys. For RightArrow it has a small value and for FN + RightArrow it has a bigger one. I substract them and find FN value (174 or something like that). But it does not work this way neither.

I've looked on a bunch of websites and installed several additional tools, but I can't figure it out. Could I maybe lower my brightness automatically in some other ways?

The laptop is a Lenovo Y50-70 and I run Windows 10.

Any ideas, guys? Thank you!

Morteza Asadi
  • 1,819
  • 2
  • 22
  • 39
bvg
  • 146
  • 13

3 Answers3

0

Try showkey, e.g.

$ sudo showkey -k

This will dump any key press to stdout.

Kris
  • 22,079
  • 3
  • 30
  • 35
  • 2
    I forgot to mention. I run Windows 10 on my laptop. No sudo for me. :( – bvg Nov 06 '17 at 21:00
  • 2
    you could check this then : https://superuser.com/questions/189065/key-code-checker-for-windows – Loïc Nov 06 '17 at 21:01
  • Thank you, Loic. FN+Right (for brightness) does not throw a result unfortunately. :( – bvg Nov 07 '17 at 15:11
0

The Fn key does not have a scan code. Send a virtual key instead.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
0

This is a duplicate of many other questions such as Reading "Fn" key and Intercepting the Fn key on laptops (I don't have enough reputation to mark it so).

TLDR: In at least most cases it's impossible, it's a functionality handled internally by the laptop and not manageable from the operating system

gbr
  • 1,264
  • 8
  • 27
  • I've checked them out before, of course, but they were asked 6 and 8 years ago. Things changed since then, isn't it? :( – bvg Nov 07 '17 at 15:18
  • @bvg So you duplicated a question knowingly without even referencing the old ones you already checked? – gbr Nov 07 '17 at 15:30
  • @bvg Things haven't changed, by the way. And for the brightness functions, it's very likely that even the (potential) models that do send scan codes most likely intend them as notifications _after the fact_ , and sending them from an application would have no effect on the brightness (if it weren't so the brightness controls would not work outside operating systems that support them). – gbr Nov 07 '17 at 15:37