g-p-m should display battery status on KEY_BATTERY

Bug #22451 reported by Martin Willemoes Hansen
56
Affects Status Importance Assigned to Milestone
gnome-power-manager (Ubuntu)
Fix Released
Medium
Daniel Silverstone
hal (Ubuntu)
Fix Released
Medium
Paul Sladen

Bug Description

Breezy on a HP NC4200 laptop.

The key for "battery info" does nothing.
The key is located on the same key as f8.

Revision history for this message
Matt Zimmerman (mdz) wrote :

What should it do?

Revision history for this message
Martin Willemoes Hansen (mwh) wrote :

Created an attachment (id=4100)
This is what the battery button does in windows.

Revision history for this message
Daniel Silverstone (dsilvers) wrote :

Once we have a keysym/code we can make this button activate g-p-m's battery info

Revision history for this message
Martin Willemoes Hansen (mwh) wrote :

I think this is the keysym/code: 0x9f

Revision history for this message
Martin Willemoes Hansen (mwh) wrote :

Ah, sorry the above is wrong, its for the presentation button, the battery button has this keysym/code: 0xd9

Revision history for this message
Martin Willemoes Hansen (mwh) wrote :

Same issue for Flight 5

Revision history for this message
Andreas Schildbach (schildbach) wrote :

On the Dell Latitude X1 running Breezy, neither xev nor showkey capture Fn-F3 (Battery).

However, I see this output in kern.log:

Mar 15 19:27:52 localhost kernel: [4297940.314000] atkbd.c: Unknown key pressed (translated set 2, code 0x87 on isa0060/serio0).
Mar 15 19:27:52 localhost kernel: [4297940.314000] atkbd.c: Use 'setkeycodes e007 <keycode>' to make it known.

Revision history for this message
Paul Sladen (sladen) wrote :

KEY_BATTERY is currently aliased to KEY_F24 until such a point as there's proper kernel assignment <256; see:

  grep -i battery /usr/share/hotkey-setup/*.hk

I think Kinnison has already done the code to gnome-power-manager to pop-down the notification box, so I guess they just need matching up.

Changed in hotkey-setup:
assignee: mjg59 → dsilvers
status: Unconfirmed → Confirmed
Revision history for this message
Richard Hughes (richard-hughes) wrote : Re: g-p-m should display battery status on KEY_F24 (covering for KEY_BATTERY)

Does the hal input addon monitor F24? You can test by doing lshal -m and then pressing the button. It's trivial to add to g-p-m if it does.

Revision history for this message
Paul Sladen (sladen) wrote :

Yes, that's the other thing I was going to suggest:

  $ sudo acpi_fakekey 194
  interface=org.freedesktop.Hal.Device; member=Condition
 string "ButtonPressed" string "f24"

If you'd prefer that, 'hald-addon-keyboard' can be patched to send "battery" for that key and then you wouldn't have to worry when/if we get a better assignment as it'll be abstracted away.

Revision history for this message
Richard Hughes (richard-hughes) wrote :

"battery-info" is probably better, and I can patch g-p-m to listen for "battery-info" instead of "www" which is what it listens now for.

Revision history for this message
Matthew Garrett (mjg59) wrote : Re: [Bug 22451] g-p-m should display battery status on KEY_F24 (covering for KEY_BATTERY)

KEY_BATTERY ought to be keycode 236. I've submitted a patch to upstream.
Can we go with that rather than F24?

--
Matthew Garrett | <email address hidden>

Revision history for this message
Richard Hughes (richard-hughes) wrote : Re: g-p-m should display battery status on KEY_F24 (covering for KEY_BATTERY)

Matthew, can you send a patch to hal-devel for the addon for key 236, and I'll change g-p-m to listen for "battery-info" rather than "www". Many thanks.

Revision history for this message
Paul Sladen (sladen) wrote :

IIRC, all the other 'hal-keyboard-addon' codes are the KEY_NAME from 'linux/input.h' processed with:

  s/^KEY_//;y/A-Z/a-z/

so if Matthew sent 'KEY_BATTERY' upstream that would be just "battery".

Revision history for this message
Richard Hughes (richard-hughes) wrote :

Sure, that makes sense. Matthew, how's that upstream patch going?

Revision history for this message
Matthew Garrett (mjg59) wrote :

It's been accepted upstream, but doesn't seem to have been committed anywhere yet.

Revision history for this message
Paul Sladen (sladen) wrote :

g-p-m can be fixed to listen for "battery" independently.

Then when it's sorted upstream only acpi-support, hotkey-setup and hal-addon-keyboard will need patching and for the moment it should allow KEY_WWW to operate again normally.

Revision history for this message
Richard Hughes (richard-hughes) wrote :

2006-03-22 Richard Hughes <email address hidden>
 * src/gpm-manager.c: Use the button "battery" rather than "www" to show the battery status. This depends on mjg59's kernel addition and the use of a HAL with the new button patched in.

Revision history for this message
Martin Willemoes Hansen (mwh) wrote :

Last tested on Dapper Flight 5

magic number of the hotkey: 0xd9

Laptop: Compaq nc4200

Revision history for this message
Paul Sladen (sladen) wrote :

Martin, please could you file a new bug against 'hotkey-setup' for your laptop with the dmidecode and keycode information on:

  https://wiki.ubuntu.com/LaptopTestingTeam/HotkeyResearch

Many Thanks,

At the moment, the status of this bug is that:

  hotkey-setup/acpi-support maps $KEY to KEY_BATTERY (depending on the laptop)
  KEY_BATTERY is currently aliased to something else while we wait for a code from upstream
  hald-addon-keyboard needs to convert "KEY_BATTERY" to send "battery" key signal over DBus
  gnome-power-manager listens for "battery" signal and displays dialogue.

Only the first and last are currently done.

Revision history for this message
Martin Willemoes Hansen (mwh) wrote :
Paul Sladen (sladen)
Changed in hal:
assignee: nobody → sladen
status: Unconfirmed → Fix Committed
Revision history for this message
Paul Sladen (sladen) wrote :

The rest of the stack should be fixed, I think it's just waiting on a fixed 'g-p-m' pulling in.

Richard: this fix should go in 2.14.1 :)

Revision history for this message
Richard Hughes (richard-hughes) wrote :

Paul, the "www" -> "battery" fix is already in the 2.14 branch, so it'll be in 2.14.1

Revision history for this message
Paul Sladen (sladen) wrote :

 hal (0.5.7-1ubuntu9) dapper; urgency=low
 .
   * debian/patches/10_volume_and_aliased_keys.patch (addon-keyboard):
     - Add macro, volume* and mute keys (special codes <128)
     - Add in 'aliased-keys' mirrored onto F19..F23
     - Add battery key at value 236, (waiting for upstream), [Malone: #22451]

Changed in hal:
status: Fix Committed → Fix Released
Revision history for this message
apelete (apelete) wrote :

Ok, "www" shortcut works now (on Asus V6 laptop here), but there still is something annoying:
Why does the battery's state tooltip always appears when you use the www button ? I mean it launches the browser now, but it also makes that unwanted tooltip to appear (and it doesn't dissapear by itself, you have to close it yourself).
Will this be the final behaviour of the www shortcut ?

Revision history for this message
Matthew Garrett (mjg59) wrote :

No, this will not be the final behaviour.

Revision history for this message
Andreas Schildbach (schildbach) wrote :

What's the status of this bug? In Dapper Beta 1, the Battery Hotkey still does not have any visible effect.

Revision history for this message
Daniel Silverstone (dsilvers) wrote :

This was fixed in the 2.14.3-0ubuntu1 upload.

Changed in gnome-power-manager:
status: Confirmed → Fix Released
Revision history for this message
Andreas Schildbach (schildbach) wrote :

I can confirm that this works now on Flight 7. Thanks a lot!

Revision history for this message
Paul Sladen (sladen) wrote :

gnome-power-manager (2.14.3-0ubuntu1) dapper; urgency=low

  * New upstream release on stable branch
    Highlights since 2.14.0 include:
     - Use 'battery' rather than 'www' closes: launchpad #22451:

Revision history for this message
Martin Willemoes Hansen (mwh) wrote :

Works on nc4200, Dapper final release

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.