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

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 07-29-2012, 12:23 AM   #1
jmseight
Zealot
jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'
 
Posts: 130
Karma: 10000
Join Date: Mar 2012
Device: Kindle 3G, Kindle Touch 3G, iRiver Story HD, Sony Reader
Search bar launch functions

Hi All,

By modifying the "/usr/share/webkit-1.0/pillow/javascripts/search_bar.js" file, it is very easy to modify the behavior of the back, home and store buttons.

I was able to make the store button, so it will make TTS with speed 220 on the first tap, and if it is already set, (on the second tap) launch the store:

Code:
var m_systemCallbacks = {
        back: function () {
            nativeBridge.setIntLipcProperty(APP_MANAGER_ID, 'backward', 0);
        },
        home: function() {
            nativeBridge.setLipcProperty(APP_MANAGER_ID, 'start', HOME_ID);
        },
        store: function() {
            if (nativeBridge.getIntLipcProperty('com.lab126.tts', 'TtsISpeed') !
                nativeBridge.setIntLipcProperty('com.lab126.tts', 'TtsISpeed', T
            } else {
                nativeBridge.setLipcProperty(APP_MANAGER_ID, 'start', STORE_ID);
            }

        }
    };
Does anyone know how to chage the search bar so it can add new functionality with user typed parameters?

For example, type TTS speed in number into the search bar, and select TTS and have it go to that speed?

I noticed that catalog (My Items), store (Kindle Store), wikipedia (Wikipedia), and dictionary (Dictionary) are defined.

Thanks,
James
jmseight is offline   Reply With Quote
Old 07-29-2012, 12:39 AM   #2
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,903
Karma: 6677485
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Quote:
Originally Posted by jmseight View Post
Hi All,
Does anyone know how to chage the search bar so it can add new functionality with user typed parameters?

For example, type TTS speed in number into the search bar, and select TTS and have it go to that speed?
Not in that combination (search bar + button). But you can define your own (parameterized) search bar shortcuts. See http://wiki.mobileread.com/wiki/Kind..._Bar_Shortcuts and the source of the usbnetwork package.

If there was a LIPC property containing the search bar text, you could also read it from the script executed on button press. But such a property doesn't exist.

Last edited by ixtab; 07-29-2012 at 12:42 AM.
ixtab is offline   Reply With Quote
Old 07-29-2012, 12:51 AM   #3
jmseight
Zealot
jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'
 
Posts: 130
Karma: 10000
Join Date: Mar 2012
Device: Kindle 3G, Kindle Touch 3G, iRiver Story HD, Sony Reader
That is another thing I am thinking of, to make a customer search bar shortcut. Is this possible? Woudl you please point me to the link.

I am thinking something like this:

1) in the search bar, type ";tts 220" and it will execute lipc-set-prop command for TtsISpeed 220.

OR

2) in the search bar, type "220", and add a search menu item "TTS Speed" which will execute lipc-set-prop command for TtsISpeed 220.

Besides TTS Speed, I am thinking there will be wide appicabilty for other customizations. For example, ";mg 10" or "10" Margin for 10 pix horizontal margin, ";vol 10" or "10" Volume" for volume at 10, or any other feature that the user can type in a number or string to set.

Thanks,
James

Thanks,
James
jmseight is offline   Reply With Quote
Old 07-29-2012, 12:54 AM   #4
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,903
Karma: 6677485
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Quote:
Originally Posted by jmseight View Post
That is another thing I am thinking of, to make a customer search bar shortcut. Is this possible? Woudl you please point me to the link.
Yes, it's possible, my previous reply contains both a link and another pointer about it

1) is possible, 2) isn't.

Did you actually read my previous reply?

Last edited by ixtab; 07-29-2012 at 12:56 AM.
ixtab is offline   Reply With Quote
Old 07-29-2012, 01:57 AM   #5
jmseight
Zealot
jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'
 
Posts: 130
Karma: 10000
Join Date: Mar 2012
Device: Kindle 3G, Kindle Touch 3G, iRiver Story HD, Sony Reader
Sorry I did not read the last paragraph. Yes, it works perfectly using the debug of the search bar with parameter $1.

Thanks,
James
jmseight is offline   Reply With Quote
Old 07-29-2012, 02:04 AM   #6
jmseight
Zealot
jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'
 
Posts: 130
Karma: 10000
Join Date: Mar 2012
Device: Kindle 3G, Kindle Touch 3G, iRiver Story HD, Sony Reader
Hi,

I found that using the "." instead of ";" is much better because you do not have to hit the "123" key to type in the ".".

My modification to debug_cmds.json are the addition of the following:
Code:
    ";ttsspeed" : "/usr/local/bin/ttsspeed.sh",
    ";ts" : "/usr/local/bin/ttsspeed.sh",
    ".ts" : "/usr/local/bin/ttsspeed.sh",
and the following file in /usr/local/bin/ttsspeed.sh:
Code:
#!/bin/sh

# By James Yeh

LIPC_SET_PROP=/usr/bin/lipc-set-prop

${LIPC_SET_PROP} com.lab126.tts TtsISpeed $1
This allows the typing of the following into the search bar:
;ttsspeed 220
;ts 220
.ts 220

The last one is the easiest to type.

Thanks,
James
jmseight is offline   Reply With Quote
Old 07-29-2012, 02:48 AM   #7
ixtab
(offline)
ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.ixtab ought to be getting tired of karma fortunes by now.
 
ixtab's Avatar
 
Posts: 2,903
Karma: 6677485
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
Quote:
Originally Posted by jmseight View Post
Hi,
I found that using the "." instead of ";" is much better because you do not have to hit the "123" key to type in the ".".
Nice finding!

Just out of curiosity, I actually tried to set the TTS speed to the 220 value you're advocating. Sounds... interesting
ixtab is offline   Reply With Quote
Old 07-30-2012, 01:23 AM   #8
jmseight
Zealot
jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'jmseight knows the difference between 'who' and 'whom'
 
Posts: 130
Karma: 10000
Join Date: Mar 2012
Device: Kindle 3G, Kindle Touch 3G, iRiver Story HD, Sony Reader
Hi ixtab,

This creates a launchpad-like behavior on K5.

Instead of Shift-X-Y on K3, we have Tap-Tap-.-x-y-Enter on K5. This is slightly more cumbersome.

But it does alllow entering of parameters.

Yes, TTS at 220 is very fast. I find that I can actually read faster - if I read and listen at the same time. It works for me becasue it is great when I am traveling - waiting for a plane, riding in a taxi or bus, etc, when I don't want to be actively reading with my eyes. I find that I can actually listen at 250 if I REALLY concentrate.

Thanks,
James
jmseight 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
[KT]Turn store button on search bar to browser button aditya3098 Kindle Developer's Corner 68 06-07-2014 06:56 AM
Adding private commands to the search bar Leeron Kindle Developer's Corner 8 07-07-2011 02:53 AM
Button Behavior for the new highlight toggle next to the search bar ldolse Library Management 9 04-17-2011 09:33 AM
Error message whenever cursor passes over "Search" bar FizzyWater Calibre 2 02-22-2009 09:37 AM


All times are GMT -4. The time now is 10:04 AM.


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