Keymap Quirk Report: Samsung NC20

Dirk Thierbach dthierbach at gmx.de
Mon Aug 3 23:23:17 PDT 2009


The Samsung NC20 laptop has keyboard quirks similar to the NC10; by inserting
"NC20" in the match in 30-keymap-misc.fdi as follows

        <match key="/org/freedesktop/Hal/devices/computer:system.hardware.product" contains_outof="NC10;NC20;SP55S;SQ45S70S;SX60P;SX30S;R59P/R60P/R61P;Q210;Q310;X05">

everything seems to work. For the record, I'm able to produce the following
scancodes:

Fn+F2     -> e003:battery
Fn+F4     -> e002:switchvideomode
Fn+F5     -> e004:prog1              # backlight on/off
Fn+F7     -> e031:prog2              # Samsung Magic Doctor
Fn+F8     -> e033:prog3              # switch power mode
Fn+F9     -> e006:wlan
Fn+F10    -> e079:f22                # Touchpad off
Fn+F10    -> e077:f22                # Touchpad on
Fn+Up     -> e008:brightnessup  
Fn+Down   -> e009:brightnessdown

Fn+F3 (euro smbol) produces some key sequence that makes no sense to me,
namely: press LeftAlt, press and release KP0,KP1,KP2,KP8, release LeftAlt.

Fn+F6 (mute) already produces the Mute keycode, and the keypad keys
simulated through Fn also produce their corresponding keycode.

I haven't been able to produce the other scancodes that are mentioned
in this section in 30-keymap-misc.fdi, that is

e034:wlan 
0074:prog1
0075:www  
0078:mail 

but that probably doesn't matter.

Questions:

1) Which application programs intercept these keycodes and are used to
actually control backlight, volume etc.? I'm using neither Gnome nor
KDE, but just fvwm2 with any applications I need, so I suspect I have
to write one myself? Or can I re-use an existing one?

2) I noticed there are scripts in hal to for example get or set lcd
brightness (though not to directly increase or decrease them). How are 
these scripts supposed to be executed? 

3) If I have to write my own application(s) to control backlight, volume,
video switching and wlan rfkill, what's the recommended portable way to do so?
Use hal to call somehow the above scripts? Add more custom scripts?

In case it's important, excerpt from lshal:

udi = '/org/freedesktop/Hal/devices/computer_backlight'
  info.capabilities = {'laptop_panel'} (string list)
  info.category = 'laptop_panel'  (string)
  info.interfaces = {'org.freedesktop.Hal.Device.LaptopPanel'} (string list)
  info.parent = '/org/freedesktop/Hal/devices/computer'  (string)
  info.product = 'Generic Backlight Device'  (string)
  info.subsystem = 'backlight'  (string)
  info.udi = '/org/freedesktop/Hal/devices/computer_backlight'  (string)
  laptop_panel.access_method = 'general'  (string)
  laptop_panel.num_levels = 8  (0x8)  (int)
  linux.hotplug_type = 2  (0x2)  (int)
  linux.subsystem = 'backlight'  (string)
  linux.sysfs_path = '/sys/devices/virtual/backlight/acpi_video0'  (string)
  org.freedesktop.Hal.Device.LaptopPanel.method_argnames = {'brightness_value', ''} (string list)
  org.freedesktop.Hal.Device.LaptopPanel.method_execpaths = {'hal-system-lcd-set-brightness', 'hal-system-lcd-get-brightness'} (string list)
  org.freedesktop.Hal.Device.LaptopPanel.method_names = {'SetBrightness', 'GetBrightness'} (string list)
  org.freedesktop.Hal.Device.LaptopPanel.method_signatures = {'i', ''} (string list)

udi = '/org/freedesktop/Hal/devices/pci_1106_3288_sound_card_0_alsa_playback_0'
  alsa.card = 0  (0x0)  (int)
  alsa.card_id = 'HDA VIA VT82xx'  (string)
  alsa.device = 0  (0x0)  (int)
  alsa.device_file = '/dev/snd/pcmC0D0p'  (string)
  alsa.device_id = 'ALC272 Analog'  (string)
  alsa.originating_device = '/org/freedesktop/Hal/devices/pci_1106_3288_sound_card_0'  (string)
  alsa.pcm_class = 'generic'  (string)
  alsa.type = 'playback'  (string)
  info.capabilities = {'alsa'} (string list)
  info.category = 'alsa'  (string)
  info.parent = '/org/freedesktop/Hal/devices/pci_1106_3288_sound_card_0'  (string)
  info.product = 'ALC272 Analog ALSA Playback Device'  (string)
  info.subsystem = 'sound'  (string)
  info.udi = '/org/freedesktop/Hal/devices/pci_1106_3288_sound_card_0_alsa_playback_0'  (string)
  linux.device_file = '/dev/snd/pcmC0D0p'  (string)
  linux.hotplug_type = 2  (0x2)  (int)
  linux.subsystem = 'sound'  (string)
  linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:14.0/sound/card0/pcmC0D0p'  (string)
udi = '/org/freedesktop/Hal/devices/pci_1106_3288_sound_card_0_alsa_control__1'
  alsa.card = 0  (0x0)  (int)
  alsa.card_id = 'HDA VIA VT82xx'  (string)
  alsa.device_file = '/dev/snd/controlC0'  (string)
  alsa.originating_device = '/org/freedesktop/Hal/devices/pci_1106_3288_sound_ca
rd_0'  (string)
  alsa.type = 'control'  (string)
  info.capabilities = {'alsa'} (string list)
  info.category = 'alsa'  (string)
  info.parent = '/org/freedesktop/Hal/devices/pci_1106_3288_sound_card_0'  (stri
ng)
  info.product = 'HDA VIA VT82xx ALSA Control Device'  (string)
  info.subsystem = 'sound'  (string)
  info.udi = '/org/freedesktop/Hal/devices/pci_1106_3288_sound_card_0_alsa_contr
ol__1'  (string)
  linux.device_file = '/dev/snd/controlC0'  (string)
  linux.hotplug_type = 2  (0x2)  (int)
  linux.subsystem = 'sound'  (string)
  linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:14.0/sound/card0/controlC0
'  (string)

X driver is OpenChrome, chipset VX800.

Thanks in advance for any help or pointers. Please CC me in replies, I am
not subscribed to the mailing list.

- Dirk


More information about the hal mailing list