![]() |
#1 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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); } } }; 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 |
![]() |
![]() |
![]() |
#2 | |
(offline)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Quote:
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. |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 |
![]() |
![]() |
![]() |
#4 | |
(offline)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Quote:
![]() 1) is possible, 2) isn't. Did you actually read my previous reply? ![]() Last edited by ixtab; 07-29-2012 at 12:56 AM. |
|
![]() |
![]() |
![]() |
#5 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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", Code:
#!/bin/sh # By James Yeh LIPC_SET_PROP=/usr/bin/lipc-set-prop ${LIPC_SET_PROP} com.lab126.tts TtsISpeed $1 ;ttsspeed 220 ;ts 220 .ts 220 The last one is the easiest to type. Thanks, James |
![]() |
![]() |
![]() |
#7 |
(offline)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
|
![]() |
![]() |
![]() |
#8 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[KT]Turn store button on search bar to browser button | aditya3098 | Kindle Developer's Corner | 74 | 05-19-2017 08:33 PM |
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 |