-rw-r--r-- | libopie2/opiecore/device/odevice_ipaq.cpp | 4 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_mypal.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp index 5272a3c..a221e23 100644 --- a/libopie2/opiecore/device/odevice_ipaq.cpp +++ b/libopie2/opiecore/device/odevice_ipaq.cpp | |||
@@ -296,32 +296,36 @@ bool iPAQ::filter ( int /*unicode*/, int keycode, int modifiers, bool isPress, b | |||
296 | case Key_Down : { | 296 | case Key_Down : { |
297 | if (( d->m_model == Model_iPAQ_H31xx ) || | 297 | if (( d->m_model == Model_iPAQ_H31xx ) || |
298 | ( d->m_model == Model_iPAQ_H38xx )) { | 298 | ( d->m_model == Model_iPAQ_H38xx )) { |
299 | newkeycode = Key_Left + ( keycode - Key_Left + 2 ) % 4; | 299 | newkeycode = Key_Left + ( keycode - Key_Left + 2 ) % 4; |
300 | } | 300 | } |
301 | // Rotate the cursor keys by 270 | 301 | // Rotate the cursor keys by 270 |
302 | // keycode - Key_Left = position of the button starting from left clockwise | 302 | // keycode - Key_Left = position of the button starting from left clockwise |
303 | // add the rotation to it and modolo. No we've the original offset | 303 | // add the rotation to it and modolo. No we've the original offset |
304 | // add the offset to the Key_Left key | 304 | // add the offset to the Key_Left key |
305 | if (( d->m_model == Model_iPAQ_H5xxx ) || | 305 | if (( d->m_model == Model_iPAQ_H5xxx ) || |
306 | ( d->m_model == Model_iPAQ_H191x ) || | 306 | ( d->m_model == Model_iPAQ_H191x ) || |
307 | ( d->m_model == Model_iPAQ_H1940 )) | 307 | ( d->m_model == Model_iPAQ_H1940 )) |
308 | newkeycode = Key_Left + ( keycode - Key_Left + 3 ) % 4; | 308 | newkeycode = Key_Left + ( keycode - Key_Left + 3 ) % 4; |
309 | break; | 309 | break; |
310 | } | 310 | } |
311 | 311 | ||
312 | // map Power Button short/long press to F6 for h191x | ||
313 | case Key_F6: | ||
314 | if ( d->m_model != Model_iPAQ_H191x ) | ||
315 | break; | ||
312 | // map Power Button short/long press to F34/F35 | 316 | // map Power Button short/long press to F34/F35 |
313 | case Key_SysReq: { | 317 | case Key_SysReq: { |
314 | if ( isPress ) { | 318 | if ( isPress ) { |
315 | if ( m_power_timer ) | 319 | if ( m_power_timer ) |
316 | killTimer ( m_power_timer ); | 320 | killTimer ( m_power_timer ); |
317 | m_power_timer = startTimer ( 500 ); | 321 | m_power_timer = startTimer ( 500 ); |
318 | } | 322 | } |
319 | else if ( m_power_timer ) { | 323 | else if ( m_power_timer ) { |
320 | killTimer ( m_power_timer ); | 324 | killTimer ( m_power_timer ); |
321 | m_power_timer = 0; | 325 | m_power_timer = 0; |
322 | QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, true, false ); | 326 | QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, true, false ); |
323 | QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, false, false ); | 327 | QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, false, false ); |
324 | } | 328 | } |
325 | newkeycode = Key_unknown; | 329 | newkeycode = Key_unknown; |
326 | break; | 330 | break; |
327 | } | 331 | } |
diff --git a/libopie2/opiecore/device/odevice_mypal.cpp b/libopie2/opiecore/device/odevice_mypal.cpp index da0272e..7e1245a 100644 --- a/libopie2/opiecore/device/odevice_mypal.cpp +++ b/libopie2/opiecore/device/odevice_mypal.cpp | |||
@@ -136,34 +136,34 @@ bool MyPal::filter ( int /*unicode*/, int keycode, int modifiers, bool isPress, | |||
136 | int newkeycode = keycode; | 136 | int newkeycode = keycode; |
137 | 137 | ||
138 | switch ( keycode ) { | 138 | switch ( keycode ) { |
139 | case Key_Left : | 139 | case Key_Left : |
140 | case Key_Right: | 140 | case Key_Right: |
141 | case Key_Up : | 141 | case Key_Up : |
142 | case Key_Down : { | 142 | case Key_Down : { |
143 | // Rotate the cursor keys by 270 | 143 | // Rotate the cursor keys by 270 |
144 | // keycode - Key_Left = position of the button starting from left clockwise | 144 | // keycode - Key_Left = position of the button starting from left clockwise |
145 | // add the rotation to it and modolo. No we've the original offset | 145 | // add the rotation to it and modolo. No we've the original offset |
146 | // add the offset to the Key_Left key | 146 | // add the offset to the Key_Left key |
147 | if ( d->m_model == Model_MyPal_716 ) | 147 | if ( d->m_model == Model_MyPal_716 ) |
148 | newkeycode = Key_Left + ( keycode - Key_Left + 3 ) % 4; | 148 | newkeycode = Key_Left + ( keycode - Key_Left + 3 ) % 4; |
149 | break; | 149 | break; |
150 | } | 150 | } |
151 | 151 | ||
152 | // map Power Button short/long press to F34/F35 | 152 | // map Power Button short/long press to F6 |
153 | case Key_SysReq: { | 153 | case Key_F6: { |
154 | if ( isPress ) { | 154 | if ( isPress ) { |
155 | if ( m_power_timer ) | 155 | if ( m_power_timer ) |
156 | killTimer ( m_power_timer ); | 156 | killTimer ( m_power_timer ); |
157 | m_power_timer = startTimer ( 500 ); | 157 | m_power_timer = startTimer ( 500 ); |
158 | } | 158 | } |
159 | else if ( m_power_timer ) { | 159 | else if ( m_power_timer ) { |
160 | killTimer ( m_power_timer ); | 160 | killTimer ( m_power_timer ); |
161 | m_power_timer = 0; | 161 | m_power_timer = 0; |
162 | QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, true, false ); | 162 | QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, true, false ); |
163 | QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, false, false ); | 163 | QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, false, false ); |
164 | } | 164 | } |
165 | newkeycode = Key_unknown; | 165 | newkeycode = Key_unknown; |
166 | break; | 166 | break; |
167 | } | 167 | } |
168 | } | 168 | } |
169 | 169 | ||