Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 01-29-2013, 06:42 PM   #1
j4GGy
Junior Member
j4GGy began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jan 2013
Location: Germany
Device: KoBo Glo
How to register button press on Glo?

Hi Guys,

I just looked around the forum and I didn't find very much regarding that matter. If there is a thread about it, just point me in the right direction and I'll stand corrected

Anyways... How can I register button presses using QT 4.8 on my Glo? I don't mean the touchscreen, I mean the light and on/off-buttons. So far my application has a main window/widget derived from the QLabel-class. QLabel::keyPressEvent(...) however is not triggered when I press the light or the on/off-button. So my guess is that either I need something like a global hook or more likely I just don't have the right "keyboard"-driver loaded. Adding

Code:
export QWS_KEYBOARD=imx508kbd:/dev/input/event0
to the sh-script starting my application did not work, though.

Any suggestions?
j4GGy is offline   Reply With Quote
Old 01-30-2013, 12:53 PM   #2
sergeyvl12
ebook fan
sergeyvl12 ought to be getting tired of karma fortunes by now.sergeyvl12 ought to be getting tired of karma fortunes by now.sergeyvl12 ought to be getting tired of karma fortunes by now.sergeyvl12 ought to be getting tired of karma fortunes by now.sergeyvl12 ought to be getting tired of karma fortunes by now.sergeyvl12 ought to be getting tired of karma fortunes by now.sergeyvl12 ought to be getting tired of karma fortunes by now.sergeyvl12 ought to be getting tired of karma fortunes by now.sergeyvl12 ought to be getting tired of karma fortunes by now.sergeyvl12 ought to be getting tired of karma fortunes by now.sergeyvl12 ought to be getting tired of karma fortunes by now.
 
Posts: 563
Karma: 2518608
Join Date: Dec 2010
Device: PocketBook 301+, Kindle 3 Wi-Fi, Onyx Boox A62, Kindle Touch
cat /dev/input/event0

responds to "Home" and "Power" buttons on my Kobo Touch

I think that I'll implement my own Qt keyboard plugin for my Qt 4.8.4 build soon...
sergeyvl12 is offline   Reply With Quote
Old 01-30-2013, 02:45 PM   #3
j4GGy
Junior Member
j4GGy began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jan 2013
Location: Germany
Device: KoBo Glo
thanks for the response - I knew that /dev/input/event0 corresponds to those button events, but I've never written a keyboard Qt-plugin/driver before...

I am planning on taking a look at the sources of the Kobo-mousedriver when I find the time. Today I just roamed the forum trying to find those - after 1 hour I found out that it was thread #1
j4GGy is offline   Reply With Quote
Old 01-31-2013, 05:04 PM   #4
koenieee
Enthusiast
koenieee doesn't litterkoenieee doesn't litterkoenieee doesn't litter
 
Posts: 49
Karma: 208
Join Date: Nov 2012
Device: Kobo Glo
It would be nice to have the Kobo QT Keyboard working, but that didn't work for me (using the command in the Main post)
koenieee is offline   Reply With Quote
Old 02-01-2013, 08:06 PM   #5
j4GGy
Junior Member
j4GGy began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jan 2013
Location: Germany
Device: KoBo Glo
I found the time (and documentation) to build a Qt keyboard driver. Basicly I just transformed sergeyvl12's code for the touchscreen driver to fit the buttons events. It's attached to this post. Using it via

Code:
export QWS_KEYBOARD=KoboKBD
or to enable debugging

Code:
export QWS_KEYBOARD=KoboKBD:debug
causes Qt to recognize button presses. I only tested it with my Glo which of course only uses the keys 90 (light button) and 116 (on/off-slider). The driver is written in such a way that it will send (almost) everything going on in /dev/input/event0 to Qt's key-processing-system so that one can easily use

Code:
QWidget::keyPressEvent(QKeyEvent*)
and


Code:
QWidget::keyReleaseEvent(QKeyEvent*)
in applications. That means that it could work on a Touch/Mini/Wifi, too. Would be nice if someone could confirm/disprove that.

I would further really appreciate it if one of the more experienced Qt coders around here would take a look at the source code because for example I have no idea what the unicode parameter is for in the QWSKeyboardHandler's function processKeyEvent. My guess is that it's not important but thats just a guess

edit: woops, there was no debugging implemented in the former attachment... now it's in there and I just found out that there is a third keycode for the kobo glo: 59 - it's when you use a sleepcover!

PS: The driver's written and built with Qt 4.8.4!
Attached Files
File Type: gz KoboKbd.tar.gz (14.2 KB, 71 views)

Last edited by j4GGy; 02-01-2013 at 08:34 PM.
j4GGy is offline   Reply With Quote
Old 02-02-2013, 06:39 PM   #6
sergeyvl12
ebook fan
sergeyvl12 ought to be getting tired of karma fortunes by now.sergeyvl12 ought to be getting tired of karma fortunes by now.sergeyvl12 ought to be getting tired of karma fortunes by now.sergeyvl12 ought to be getting tired of karma fortunes by now.sergeyvl12 ought to be getting tired of karma fortunes by now.sergeyvl12 ought to be getting tired of karma fortunes by now.sergeyvl12 ought to be getting tired of karma fortunes by now.sergeyvl12 ought to be getting tired of karma fortunes by now.sergeyvl12 ought to be getting tired of karma fortunes by now.sergeyvl12 ought to be getting tired of karma fortunes by now.sergeyvl12 ought to be getting tired of karma fortunes by now.
 
Posts: 563
Karma: 2518608
Join Date: Dec 2010
Device: PocketBook 301+, Kindle 3 Wi-Fi, Onyx Boox A62, Kindle Touch
Thanks!
sergeyvl12 is offline   Reply With Quote
Old 03-14-2013, 07:32 PM   #7
j4GGy
Junior Member
j4GGy began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jan 2013
Location: Germany
Device: KoBo Glo
It seems that one also has to place the libKoboKBD.so in
Code:
QT_PLUGIN_PATH/kbddrivers/
j4GGy is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kobo glo home/settings button not working? Tim Shaw Kobo Reader 6 12-07-2013 02:23 PM
Un-register/Re-register Nook Classic Hitchcockfan Barnes & Noble NOOK 1 08-29-2011 07:53 AM
how to de-register and register kindle3 outside USA klastbreath Amazon Kindle 3 03-31-2011 07:07 PM
GRYPHONWOOD PRESS/BLADE RED PRESS Halloween Giveaway Winter Deals, Freebies, and Resources (No Self-Promotion) 0 10-30-2009 07:39 AM
Unresponsive to button press Vesper Bookeen 16 03-07-2008 01:59 AM


All times are GMT -4. The time now is 08:23 AM.


MobileRead.com is a privately owned, operated and funded community.