Detect sleep and suspend key presses

pull/1/head
Timothy Pearson 11 years ago
parent 340d2058a4
commit 67312e92f2

@ -184,18 +184,19 @@ void HardwareInfo::processKeyPressEvent(unsigned int keycode, TDEEventDevice* ed
// FIXME
// How can I get specific button press/release information (instead of just "something happened to the button") from the TDE hardware library?
// FIXME
// How are sleep buttons normally handled? On my Thinkpad pressing Fn+Sleep doesn't generate an event from the ACPI sleep button event device...
// TODO: Check if we really need to monitor this events. We get maybe also
// HAL_PROPERTY_CHANGED event for the key
// if (message.startsWith("ButtonPressed")) {
kdDebug() << "ButtonPressed event from TDE HW library " << endl;
if ((edevice->eventType() == TDEEventDeviceType::ACPIPowerButton) && (keycode == KEY_POWER)) {
if (((edevice->eventType() == TDEEventDeviceType::ACPIPowerButton) || (edevice->eventType() == TDEEventDeviceType::ACPIOtherInput))
&& (keycode == KEY_POWER)) {
TQTimer::singleShot(50, this, TQT_SLOT(emitPowerButtonPressed()));
} else if ((edevice->eventType() == TDEEventDeviceType::ACPISleepButton) && (keycode == KEY_SLEEP)) {
} else if (((edevice->eventType() == TDEEventDeviceType::ACPISleepButton) || (edevice->eventType() == TDEEventDeviceType::ACPIOtherInput))
&& (keycode == KEY_SLEEP)) {
TQTimer::singleShot(50, this, TQT_SLOT(emitSleepButtonPressed()));
// } else if (value.startsWith("hibernate")) {
// TQTimer::singleShot(50, this, TQT_SLOT(emitS2diskButtonPressed()));
} else if (((edevice->eventType() == TDEEventDeviceType::ACPISuspendButton) || (edevice->eventType() == TDEEventDeviceType::ACPIOtherInput))
&& (keycode == KEY_SUSPEND)) {
TQTimer::singleShot(50, this, TQT_SLOT(emitS2diskButtonPressed()));
// } else if (value.startsWith("brightness-")) {
// if (!brightness_in_hardware && value.endsWith("-up"))
// TQTimer::singleShot(50, this, TQT_SLOT(brightnessUpPressed()));

Loading…
Cancel
Save