DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: FINISHED: Speed It Up, or Slow It Down  (Read 15,993 times)

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 563
FINISHED: Speed It Up, or Slow It Down
« on: September 03, 2017, 09:20 AM »
Background: 

I like FBReader for reading .epubs.  Terrific program.  Except for one major omission.  For many years I've asked the developers to incorporate an auto-page-advance feature.  But no reply.

One has to manually hit page-down to go to the next page.

I can program a basic macro program to hit Page Down, repeatedly, every so many seconds -- fixed speed.  Not a big deal.

But..., there's likely a better way.

Challenge and Request:

Ideally.  Program the keypad (+) and (-) keys to increase or decrease the speed of hitting the Page Down key.  Perhaps at 5% increments or whatever.

In other words, user brings up FBReader, and some .epub (but probably would work with any such reader or word processing program, or even an image viewer).  Start auto-page-advance by hitting the keypad (+) key.  Suppose the initial default is 30 seconds per page.  If that's too slow, hit the (+) key again, and the speed to next page-turn is faster.  Hit again, and faster still.

If the 30-seconds per page is too fast, hit the keypad (-) key.  And the page-turn is then made slower.  Hit again, slower still.

Whaddya think?  Doable?

Thanks much!

Nicholas Kormanik

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,649
    • Participated in NANY Challenge Eleven Times
    • Coding Snacks
    • Linux User
    • Hardware Hacker
Re: FINISHED: Speed It Up, or Slow It Down
« Reply #1 on: September 03, 2017, 11:18 AM »
With a 'little' work on WinSendKeys and WinButtons I could probably realize that.
/Ton
Ath's software collection, Quote: "A problem well stated is a problem half-solved." (Charles Kettering)

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • Participated in NANY Challenge Twice
    • Coding Snacks
Re: FINISHED: Speed It Up, or Slow It Down
« Reply #2 on: September 05, 2017, 12:32 PM »
:) Try PageDown.  The program presses PageDown every x seconds. Press Num+ and Num- to change the delay.

Save the script as PageDown.ahk. Download and install AutoHotkey to run the script.

Skrommel

Code
;PageDown.ahk
;  Presses PageDown every x seconds. Press Num+ and Num- to change the delay.
;Skrommel @ 2017

#NoEnv
#SingleInstance,Force

delay=1000
GOTO,PAGEDOWN

NumPadSub::
delay+=1000
ToolTip,Delay: %delay%
Return

NumPadAdd::
delay-=1000
If (delay<1000)
  delay=1000
ToolTip,Delay: %delay%
Return

PAGEDOWN:
Sleep,%delay%
;IfWinNotActive,FBReader
;  Goto,PAGEDOWN
Send,{PgDn}
ToolTip,PageDown
Goto,PAGEDOWN
« Last Edit: September 06, 2017, 12:24 AM by skrommel »

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,649
    • Participated in NANY Challenge Eleven Times
    • Coding Snacks
    • Linux User
    • Hardware Hacker
Re: FINISHED: Speed It Up, or Slow It Down
« Reply #3 on: September 05, 2017, 05:37 PM »
Great solution, thnx skrommel!

I hadn't started on extending WinButtons/WinSendKey, but I think this is what Nick needs.
/Ton
Ath's software collection, Quote: "A problem well stated is a problem half-solved." (Charles Kettering)

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 563
Re: FINISHED: Speed It Up, or Slow It Down
« Reply #4 on: September 05, 2017, 10:41 PM »
Terrific, skrommel.  Works better than I was hoping for.

One change request, though.  Switch the (+) and (-) keys, so that (+) speeds up, and (-) slows down.

How does user get completely out?

Interestingly one can pause simply by clicking on the desktop.  And resume by clicking on the program being read, picking right up again.

We seem to have a definite winner here.

Why in the world hasn't this been done before.....

Well, now it is.

Thanks very much!

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Re: FINISHED: Speed It Up, or Slow It Down
« Reply #5 on: September 05, 2017, 11:51 PM »
How does user get completely out?

Right-click the tray icon and choose Exit.

Interestingly one can pause simply by clicking on the desktop.  And resume by clicking on the program being read, picking right up again.

It's not paused.  That is, it's still sending a PageDown keystroke to whatever app/window has focus.  That said, the script can be easily modified to only work when your FBReader app is focused.

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • Participated in NANY Challenge Twice
    • Coding Snacks
Re: FINISHED: Speed It Up, or Slow It Down
« Reply #6 on: September 06, 2017, 12:26 AM »
@nkormanik: I swapped the Num-keys and added two lines at the bottom. If you remove the ; you can make the program only send PageDown to FPReader.

Original address: https://www.donationcoder.com/forum/index.php?topic=44291.0