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

Go Back   MobileRead Forums > E-Book Readers > More E-Book Readers > iRex > iRex Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 02-26-2009, 03:27 PM   #16
Shaggy
Wizard
Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.
 
Shaggy's Avatar
 
Posts: 4,293
Karma: 529619
Join Date: May 2007
Device: iRex iLiad, DR800SG
What I'm thinking of is something like:

In settings.h
Take the #define JumpWidth out and add it as an int in the CSettings class.

Then in settings.cpp
Add JumpWidth to the load/save routines for the manifest.
Create a getJumpWidth() method that returns the value.

In PDFPortraitView.cpp and PDFLandscapeView.cpp
Change the references from JumpWidth to settings.getJumpWidth().


That would make controlling the behavior of the long press jump easier on the users (just modify the manifest on their iLiad), rather than having to install a specific binary version that is hard coded to the behavior they want.
Shaggy is offline   Reply With Quote
Old 02-26-2009, 04:12 PM   #17
DesiLinguist
Computational Linguist
DesiLinguist doesn't litterDesiLinguist doesn't litter
 
Posts: 110
Karma: 100
Join Date: Feb 2009
Device: iLiad BE, iPhone, Kindle DX
Shaggy,

I do think your suggestion is a much better way of doing things than hard coding things. If no one else gets to it, I will give this a shot once my development environment is set up properly.

Thanks!
DesiLinguist is offline   Reply With Quote
Old 02-26-2009, 05:11 PM   #18
hansel
JSR FFD2
hansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheese
 
hansel's Avatar
 
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
Hi DesiLinguist,
Quote:
Originally Posted by DesiLinguist View Post
If no one else gets to it, I will give this a shot once my development environment is set up properly.
You might have a look here: http://www.mobileread.com/forums/sho...37&postcount=4 . I compile a lot for the Iliad, and this is my prefered environment (stable, and easy to reinstall if you corrupt it). I keep some notes here: http://wiki.hpelbers.org/Cross_compi...h_the_Irex_SDK

h.t.h. Hansel.
hansel is offline   Reply With Quote
Old 02-26-2009, 05:14 PM   #19
Shaggy
Wizard
Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.
 
Shaggy's Avatar
 
Posts: 4,293
Karma: 529619
Join Date: May 2007
Device: iRex iLiad, DR800SG
Although, I think the manifest used is unique per book, not global. So you'd have to set the JumpWidth for each book. I don't know if that's a good thing or a bad thing??? Greater flexibility, but more of a pain to change it each time.

There's probably a way of doing the same thing in a global config, but I'd have to look at it more to work out the details.
Shaggy is offline   Reply With Quote
Old 02-26-2009, 06:07 PM   #20
DesiLinguist
Computational Linguist
DesiLinguist doesn't litterDesiLinguist doesn't litter
 
Posts: 110
Karma: 100
Join Date: Feb 2009
Device: iLiad BE, iPhone, Kindle DX
hansel, thank you so much for that pointer! This is what I was looking for

BTW, I am guessing this setup would only work on a linux system, right? Which distro are you using? I am on a Mac so I will probably set up the same distro on virtualbox.

Thanks again.
DesiLinguist is offline   Reply With Quote
Old 02-27-2009, 12:52 AM   #21
hansel
JSR FFD2
hansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheese
 
hansel's Avatar
 
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
Quote:
Originally Posted by DesiLinguist View Post
BTW, I am guessing this setup would only work on a linux system, right? Which distro are you using?
Yes, you need a linux system. I'm using a recent Ubuntu. Any decent Linux with the basic developer tools installed should do...
hansel is offline   Reply With Quote
Old 02-28-2009, 10:44 AM   #22
istudy
Member
istudy began at the beginning.
 
Posts: 10
Karma: 14
Join Date: Dec 2008
Location: China
Device: irex iliad
If you want, you can try my touch version ipdfhttp://www.mobileread.com/forums/sho...462#post338462, it won't have problem with stylus touch when flip page.
istudy is offline   Reply With Quote
Old 04-14-2009, 10:13 AM   #23
Shaggy
Wizard
Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.
 
Shaggy's Avatar
 
Posts: 4,293
Karma: 529619
Join Date: May 2007
Device: iRex iLiad, DR800SG
FYI,

An iRex developer recently posted on their forum that they already have a patch available for the iLiad that disables the "long jump" feature, essentially making all page turns a 1 page jump. He said that you can contact their tech support via the website and request the patch.
Shaggy is offline   Reply With Quote
Old 04-15-2009, 03:42 AM   #24
fbrzvnrnd
Enthusiast
fbrzvnrnd is a glorious beacon of lightfbrzvnrnd is a glorious beacon of lightfbrzvnrnd is a glorious beacon of lightfbrzvnrnd is a glorious beacon of lightfbrzvnrnd is a glorious beacon of lightfbrzvnrnd is a glorious beacon of lightfbrzvnrnd is a glorious beacon of lightfbrzvnrnd is a glorious beacon of lightfbrzvnrnd is a glorious beacon of lightfbrzvnrnd is a glorious beacon of lightfbrzvnrnd is a glorious beacon of light
 
Posts: 27
Karma: 12108
Join Date: Feb 2009
Device: iLiad
Quote:
Originally Posted by Shaggy View Post
FYI,

An iRex developer recently posted on their forum
Hi, can you provide a link to the original post? I can not found it


thank you


f.
fbrzvnrnd is offline   Reply With Quote
Old 04-15-2009, 05:41 AM   #25
hansel
JSR FFD2
hansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheesehansel can extract oil from cheese
 
hansel's Avatar
 
Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
It is probably enough to change button.c for contenLister:

http://iliad.hpelbers.org/irexdox/co...6e2d2304e0e51f
  • change GDK_F1 to GDK_Page_Down
  • change GDK_F2 to GDK_Page_Up

Code:
...
00783 
00784         case PAGETURN_FORWARD:
00785             CL_LOGPRINTF("PAGETURN_FORWARD");
00786             gdk_threads_enter();
00787             pm_SendKey(GDK_Page_Down);
00788             gdk_threads_leave();
00789             break;
00790 
00791         case PAGETURN_FORWARD | BUTTON_LONG_PRESS:
00792             CL_LOGPRINTF("PAGETURN_FORWARD LONG");
00793             gdk_threads_enter();
00794             pm_SendKey(GDK_F1);
00795             gdk_threads_leave();
00796             break;
00797 
00798         case PAGETURN_BACK:
00799             CL_LOGPRINTF("PAGETURN_BACK");
00800             gdk_threads_enter();
00801             pm_SendKey(GDK_Page_Up);
00802             gdk_threads_leave();
00803             break;
00804 
00805         case PAGETURN_BACK | BUTTON_LONG_PRESS:
00806             CL_LOGPRINTF("PAGETURN_BACK LONG");
00807             gdk_threads_enter();
00808             pm_SendKey(GDK_F2);
00809             gdk_threads_leave();
00810             break;
00811 
00812         case OVERVIEW:
...
hansel is offline   Reply With Quote
Old 04-15-2009, 11:41 AM   #26
Shaggy
Wizard
Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.
 
Shaggy's Avatar
 
Posts: 4,293
Karma: 529619
Join Date: May 2007
Device: iRex iLiad, DR800SG
Quote:
Originally Posted by fbrzvnrnd View Post
Hi, can you provide a link to the original post? I can not found it
http://forum.irexnet.com/viewtopic.p...ghlight=#17578
Shaggy is offline   Reply With Quote
Old 04-15-2009, 11:51 AM   #27
Shaggy
Wizard
Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.Shaggy ought to be getting tired of karma fortunes by now.
 
Shaggy's Avatar
 
Posts: 4,293
Karma: 529619
Join Date: May 2007
Device: iRex iLiad, DR800SG
Quote:
Originally Posted by hansel View Post
It is probably enough to change button.c for contenLister:
I assume that's the way iRex did it in their patch. This method disables it entirely, rather than making it user configurable. That's probably why they only offer it as a user requested patch, rather than a global update.
Shaggy is offline   Reply With Quote
Old 03-02-2010, 04:44 AM   #28
zerospinboson
"Assume a can opener..."
zerospinboson ought to be getting tired of karma fortunes by now.zerospinboson ought to be getting tired of karma fortunes by now.zerospinboson ought to be getting tired of karma fortunes by now.zerospinboson ought to be getting tired of karma fortunes by now.zerospinboson ought to be getting tired of karma fortunes by now.zerospinboson ought to be getting tired of karma fortunes by now.zerospinboson ought to be getting tired of karma fortunes by now.zerospinboson ought to be getting tired of karma fortunes by now.zerospinboson ought to be getting tired of karma fortunes by now.zerospinboson ought to be getting tired of karma fortunes by now.zerospinboson ought to be getting tired of karma fortunes by now.
 
zerospinboson's Avatar
 
Posts: 745
Karma: 1001705
Join Date: Mar 2008
Location: Local Cluster
Device: iLiad v2, DR1000
Quote:
Originally Posted by Shaggy View Post
FYI,

An iRex developer recently posted on their forum that they already have a patch available for the iLiad that disables the "long jump" feature, essentially making all page turns a 1 page jump. He said that you can contact their tech support via the website and request the patch.
I installed that fix, but it apparently installed a different version of the ipdf viewer, because after installing it my pdf viewer was behaving 'oddly', so I reinstalled the bookmarks one again, after which the long flip feature once again 'worked' (i.e., is broken)

Last edited by zerospinboson; 03-02-2010 at 04:46 AM.
zerospinboson is online now   Reply With Quote
Old 03-10-2010, 03:26 PM   #29
A4-
Connoisseur
A4- can extract oil from cheeseA4- can extract oil from cheeseA4- can extract oil from cheeseA4- can extract oil from cheeseA4- can extract oil from cheeseA4- can extract oil from cheeseA4- can extract oil from cheeseA4- can extract oil from cheeseA4- can extract oil from cheese
 
A4-'s Avatar
 
Posts: 84
Karma: 1110
Join Date: Aug 2009
Location: Netherlands
Device: iRex iLiad v2
Instant buttons

I've been playing with the sources a few months ago and the way I changed it was as follows (code below):
For buttons that don't have a (useful) long press it instantly sends the key (instead of waiting for key_up)
So now I can hold the flipbar for ages and the nextpage changes as fast as the screen & software are able too.

The only thing I notice is that sometimes the flipbar wont register at all. I suspect that that's when it used to jump 5 pages instead of 1. Since this is probably related with the kb-driver I'm not gonna try to fix that since it doesn't bother me.

The function of button.c (contentlister) which I changed:
Code:
static void *buttonStateMachine(void *arg)
{
    int button;
    struct timespec times;
    struct timeval timev;

    enum
    {
        buttonReleased,
        buttonPressed
    } state = buttonReleased;

    button = -1;
    while (1)
    {
        CL_LOGPRINTF("smthread: start of loop, state %d", state);
        switch (state)
        {
            case buttonReleased:
                pthread_mutex_lock(&buttonCondMutex);
                CL_LOGPRINTF("smthread: waiting for press");
                pthread_cond_wait(&buttonCond, &buttonCondMutex);
                if (protectedButton == 0xFF)
                {
                    CL_LOGPRINTF("smthread: release in released");
                    pthread_mutex_unlock(&buttonCondMutex);
                }
                else
                {
                    CL_LOGPRINTF("smthread: press in released");
                    button = protectedButton;
                    state = buttonPressed;
                    pthread_mutex_unlock(&buttonCondMutex);
                }
                break;

            case buttonPressed:
                pthread_mutex_lock(&buttonCondMutex);
                // get current time, and add BUTTON_LONG_PRESS_TIMEOUT ms
                // a timeval -> timespec conversion is needed (nanosec to microsec)
// -------------  Instant Buttons ----------------
            if ( (button != MODE) && (button != OVERVIEW) && (button != CONNECT) && (button != POWER) )
		      {
				  pthread_mutex_unlock(&buttonCondMutex);
			         CL_LOGPRINTF("smthread: short flipbar button handler");
				  button_handler(button, arg);        // short flipbar
				  button = -1;  
				  state = buttonReleased;
			}
			else
			{
// -------------  Regular buttons -----------------
                gettimeofday(&timev, NULL);
                times.tv_sec = timev.tv_sec + g_timoutValue.tv_sec;
                times.tv_nsec = (timev.tv_usec * 1000) + g_timoutValue.tv_nsec;
                if (times.tv_nsec >= 1000000000)
                {
                    times.tv_nsec -= 1000000000;
                    times.tv_sec += 1;
                }
                CL_LOGPRINTF("smthread: timed waiting for release");
                if (pthread_cond_timedwait(&buttonCond, &buttonCondMutex, &times) == ETIMEDOUT)
                {
                    CL_LOGPRINTF("smthread: timeout in pressed");
                    pthread_mutex_unlock(&buttonCondMutex);
                    if (button >= 0 && button < NUM_BUTTONS)
                    {
                        CL_LOGPRINTF("smthread: long button handler");
                        button_handler(button | BUTTON_LONG_PRESS, arg);        // long
                    }
                    button = -1;
                    state = buttonReleased;
                }
                else
                {
                    if (protectedButton == 0xFF)
                    {
                        CL_LOGPRINTF("smthread: release in pressed");
                        state = buttonReleased;
                        pthread_mutex_unlock(&buttonCondMutex);
                        if (button >= 0 && button < NUM_BUTTONS)
                        {
                            CL_LOGPRINTF("smthread: short button handler");
                            button_handler(button, arg);        // short
                        }
                        button = -1;
                    }
                    else
                    {
                        CL_LOGPRINTF("smthread: press in pressed");
                        button = protectedButton;
                        pthread_mutex_unlock(&buttonCondMutex);
                    }
                }
             } 			// from instant flipbar
               break;
        }
    }
    pthread_exit(NULL);
}
I've also reversed the "settings button" so that a short press will get me to the recent documents and a long one to the settings.
A4- 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
DR800 Strange flipbar behavior penartur iRex 8 08-05-2010 10:17 PM
multiple page turns when pressing flipbar bazmi iRex 27 06-14-2009 02:19 PM
Flipbar Poll axel77 iRex 17 04-25-2008 10:12 PM
Iliad flipbar landscape use/price/hanlin johngreen99 iRex 4 03-09-2008 07:56 AM
Flipbar question JWLaRue iRex 9 03-09-2008 01:09 AM


All times are GMT -4. The time now is 02:14 PM.


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