Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Sony Reader > Sony Reader Dev Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 08-15-2007, 01:53 PM   #16
diabloNL
Gadget Force®
diabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with others
 
diabloNL's Avatar
 
Posts: 705
Karma: 2733
Join Date: Jun 2006
Location: The Netherlands
Device: Sony PRS-300 + Cybook with funny screen :P
Quote:
Originally Posted by Nogg View Post
I'm still trying to get the hang of the way things are set up in the reader (I got a nice infinite loop last night), but couldn't you create a stub function to replace one of the mutes in applicationstart and then add the functionality in main by overriding that function?
Tried that and it didn't work.


Quote:
Originally Posted by Nogg View Post
I'm doing something similar with my testing where I override doLeft and doRight in main.xml to produce the joystick page flip functionality there, instead of remapping it in applicationStart. The only difference is that I'm relying on their built-in functions.
I'm using that a lot. So by using for example this in main.xml:

Code:
<function id="doLeft">
{Some code}
</function>
With that you can use your own code that starts when the joystick left is pressed. The PROBLEM here is that I haven't figured out how to call the original function. For example:


Code:
<function id="doLeft">
if (a == 1) {
this.doRight();
}
else {
this.doLeft();
}
</function>
This won't work because it will call it's own function that it's in. Creating a loop. So it's not possible to do the original joystick left function when a !=1 We need to find out how to listen to the keys itself rather then the function they do.
diabloNL is offline   Reply With Quote
Old 08-15-2007, 02:00 PM   #17
Nogg
Literate!
Nogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it is
 
Posts: 256
Karma: 2247
Join Date: Mar 2007
Device: PRS-500
Hm, that's indeed a tricky one.

Just for reference, is the original main.xml available somewhere? I wouldn't mind taking a look at that to see what our actual base is.
Nogg is offline   Reply With Quote
Advert
Old 08-15-2007, 02:02 PM   #18
diabloNL
Gadget Force®
diabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with others
 
diabloNL's Avatar
 
Posts: 705
Karma: 2733
Join Date: Jun 2006
Location: The Netherlands
Device: Sony PRS-300 + Cybook with funny screen :P
Quote:
Originally Posted by Nogg View Post
Hm, that's indeed a tricky one.

Just for reference, is the original main.xml available somewhere? I wouldn't mind taking a look at that to see what our actual base is.
You will have to ask to Igorsk. Don't mind a copy as well myself.
diabloNL is offline   Reply With Quote
Old 08-15-2007, 02:18 PM   #19
Nogg
Literate!
Nogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it is
 
Posts: 256
Karma: 2247
Join Date: Mar 2007
Device: PRS-500
Ok, I poked him.
Nogg is offline   Reply With Quote
Old 08-15-2007, 02:33 PM   #20
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by diabloNL View Post
I have to get back to you on this one Jon. I thought the volume button worked different but now I see that the holding the volume + and - both do the exact same command (doMute). So to create history back and forward with that one function that listens if the button is pressed is a little hard to do.

The boolean key for + and - is different (0x40 and 0x41) but right know I have no idea how to listen for a pressed button other than the numeric keys by listening to their key instead of their function. This is one I have to try and find out. Could be very useful for another hack that has been sitting on my computer to be finished a while now but has a similar problem.

I will keep you posted!

EDIT: I can make it with the normal volume buttons because they use two functions. Let me know if you would like that for now.
We have now the big silver button pressed and held go page forward/page back. Can you change that to do the 10 pages forward/back instead. It semms kind of sill to have to hold for just one page turn. The history for the silver button works very well though.
JSWolf is offline   Reply With Quote
Advert
Old 08-15-2007, 03:16 PM   #21
diabloNL
Gadget Force®
diabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with others
 
diabloNL's Avatar
 
Posts: 705
Karma: 2733
Join Date: Jun 2006
Location: The Netherlands
Device: Sony PRS-300 + Cybook with funny screen :P
Quote:
Originally Posted by JSWolf View Post
We have now the big silver button pressed and held go page forward/page back. Can you change that to do the 10 pages forward/back instead. It semms kind of sill to have to hold for just one page turn. The history for the silver button works very well though.
Unfortunately it also gives problems. If I would do that then also the joystick and small buttons page flip would do ten pages at once. I hope to find a solution because it will open new possibilities.

I will try to work it out if it is possible at all.
diabloNL is offline   Reply With Quote
Old 08-15-2007, 03:33 PM   #22
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I hope so. Thank you for your efforts.
JSWolf is offline   Reply With Quote
Old 08-15-2007, 04:05 PM   #23
ns66
Connoisseur
ns66 doesn't litterns66 doesn't litter
 
Posts: 78
Karma: 156
Join Date: Jul 2007
Device: sony reader
Quote:
Originally Posted by diabloNL View Post
Tried that and it didn't work.




I'm using that a lot. So by using for example this in main.xml:

Code:
<function id="doLeft">
{Some code}
</function>
With that you can use your own code that starts when the joystick left is pressed. The PROBLEM here is that I haven't figured out how to call the original function. For example:


Code:
<function id="doLeft">
if (a == 1) {
this.doRight();
}
else {
this.doLeft();
}
</function>
This won't work because it will call it's own function that it's in. Creating a loop. So it's not possible to do the original joystick left function when a !=1 We need to find out how to listen to the keys itself rather then the function they do.
just a thought, create a new method with a different name like doLeft2, in there you call this.doLeft(), so you avoid the recursive loop, and map the key to call doLeft2
ns66 is offline   Reply With Quote
Old 08-15-2007, 04:17 PM   #24
Nogg
Literate!
Nogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it is
 
Posts: 256
Karma: 2247
Join Date: Mar 2007
Device: PRS-500
Quote:
Originally Posted by ns66 View Post
just a thought, create a new method with a different name like doLeft2, in there you call this.doLeft(), so you avoid the recursive loop, and map the key to call doLeft2
I believe diablo already tried that and using a custom-named function didn't work.
Nogg is offline   Reply With Quote
Old 08-15-2007, 05:15 PM   #25
diabloNL
Gadget Force®
diabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with others
 
diabloNL's Avatar
 
Posts: 705
Karma: 2733
Join Date: Jun 2006
Location: The Netherlands
Device: Sony PRS-300 + Cybook with funny screen :P
Quote:
Originally Posted by ns66 View Post
just a thought, create a new method with a different name like doLeft2, in there you call this.doLeft(), so you avoid the recursive loop, and map the key to call doLeft2
Quote:
Originally Posted by Nogg View Post
I believe diablo already tried that and using a custom-named function didn't work.

I did try it but I have probably done something wrong because it now works!

I just renamed doMute (x2) to doMuteB (back) and doMuteF (forward).
Thanks ns66!

Jon, I've made your hack thanks to ns66. It is number 16.
diabloNL is offline   Reply With Quote
Old 08-15-2007, 05:31 PM   #26
diabloNL
Gadget Force®
diabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with others
 
diabloNL's Avatar
 
Posts: 705
Karma: 2733
Join Date: Jun 2006
Location: The Netherlands
Device: Sony PRS-300 + Cybook with funny screen :P
I found a small bug with the direct page control and basically all hacks that work with the setPage() function. The bug is that pages flipped through this function don't get logged into history. So let's say you flip from page 1 to 2 and then use the direct page control to jump to page 10 then it will not record page 10 into history. I need to find out if this can be solved or not.
diabloNL is offline   Reply With Quote
Old 08-15-2007, 05:53 PM   #27
NatCh
Gizmologist
NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.
 
NatCh's Avatar
 
Posts: 11,615
Karma: 929550
Join Date: Jan 2006
Location: Republic of Texas Embassy at Jackson, TN
Device: Pocketbook Touch HD3
If nothing else, you could tack next & prev page calls onto the end of the routine. It'd be a bit brute force, but it'd work.
NatCh is offline   Reply With Quote
Old 08-15-2007, 06:01 PM   #28
diabloNL
Gadget Force®
diabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with othersdiabloNL plays well with others
 
diabloNL's Avatar
 
Posts: 705
Karma: 2733
Join Date: Jun 2006
Location: The Netherlands
Device: Sony PRS-300 + Cybook with funny screen :P
Quote:
Originally Posted by NatCh View Post
If nothing else, you could tack next & prev page calls onto the end of the routine. It'd be a bit brute force, but it'd work.

That could work. I could do setPage() -1 and then give the doNext function. Have to try that and if it works update the hacks catalog.

Thanks for the tip NatCh!

Last edited by diabloNL; 08-15-2007 at 06:05 PM.
diabloNL is offline   Reply With Quote
Old 08-15-2007, 06:02 PM   #29
Nogg
Literate!
Nogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it isNogg knows what time it is
 
Posts: 256
Karma: 2247
Join Date: Mar 2007
Device: PRS-500
Quote:
Originally Posted by diabloNL View Post
I found a small bug with the direct page control and basically all hacks that work with the setPage() function. The bug is that pages flipped through this function don't get logged into history. So let's say you flip from page 1 to 2 and then use the direct page control to jump to page 10 then it will not record page 10 into history. I need to find out if this can be solved or not.
Haha, I just noticed that last night, but I thought it was because I was screwing around with other stuff. Then again, maybe that was true, too. 0_o
Nogg is offline   Reply With Quote
Old 08-15-2007, 06:11 PM   #30
NatCh
Gizmologist
NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.NatCh ought to be getting tired of karma fortunes by now.
 
NatCh's Avatar
 
Posts: 11,615
Karma: 929550
Join Date: Jan 2006
Location: Republic of Texas Embassy at Jackson, TN
Device: Pocketbook Touch HD3
Quote:
Originally Posted by diabloNL View Post
Thanks for the tip NatCh!
Hah! I finally contributed something to the hacking effort!

That pretty much sums up my programming style, if it won't work the way it's "supposed" to, find a way that it will work.
NatCh is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Turn custom series column into collection on a Sony reader? dmapr Calibre 4 08-21-2010 02:31 PM
Any way to add collection information to LRF file for Sony Reader QuantamPulse LRF 2 09-05-2008 11:22 PM
PRS-500 Sony Reader customization hacks collection Alexander Turcic Sony Reader Dev Corner 0 08-16-2007 10:40 AM
Hacks for iRex iLiad and Sony Reader round-up Alexander Turcic News 10 10-24-2006 05:43 AM


All times are GMT -4. The time now is 05:17 PM.


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