DonationCoder.com Software > Post New Requests Here
Variable-speed repeated button press
nkormanik:
Imagine repeatedly pressing the Page-Down key. It can get old fast. Poor index finger.
Suppose we have a Page-Down that automatically repeats. Once every 5 seconds (the 'default'). For 100 rounds.
How cool would that be??!!
Here's the huge challenge: Create the above. With the following addition....
If user presses the Ctrl-Minus key, we multiply the 5 seconds by 1.05, and use that value in between each round.
If user presses the Ctrl-Plus key, we multiply the 5 seconds by 0.95, and use that value in between each round.
The idea is to get a 'variable-speed' repeated button press.
Here is some of the logic, as I see it:
There is a 'default' amount of time between button presses. Say, 5 seconds. There is some variable somewhere holding this value. Let's call the variable "Rest."
Every time the user hits Ctrl-Minus, the little program looks for the variable "Rest," multiplies it by 1.05, and writes that result back to the variable location. So, "Rest" is now 5.25.
If user hits Ctrl-Minus another time, current value of "Rest" is multiplied by 1.05, with the result then written to the variable. "Rest" then becomes 5.51. Etc. Etc.
Hitting Ctrl-Plus has the opposite effect. "Rest" value is multiplied by 0.95.
So, the 'loop' for each round looks something like this:
1. Check value of "Rest."
2. Wait that long.
3. Press the Page-Down key.
Any thoughts greatly appreciated. If you were to write such a program, what programming language would you use?
Nicholas Kormanik
paradisusvic:
Hi Nick, I'm doing this as a quickie release for N.A.N.Y. :Thmbsup:
what programming language would you use?
-nkormanik (July 02, 2023, 01:56 AM)
--- End quote ---
The programming language is C#.
nkormanik:
Sounds wonderful, Vic!
I hope you can accomplish this. Hope others here toss in their two cents to make the mission clearer for as many users as possible.
Ctrl-plus = page-down rate a little faster in our reader program
Ctrl-minus = page-down rate a little slower in our reader program
I use Calibre for reading epubs. I've requested for years for them to incorporate something like this. Seems that it should be relatively easy. I don't really understand why it's not. What am I missing??
Guess you'll have to be the one.
Thanks!!
skwire:
Hope others here toss in their two cents to make the mission clearer for as many users as possible.
-nkormanik (January 07, 2025, 04:36 PM)
--- End quote ---
Here's a quick'n'dirty AutoHotkey script that does what you want. Notes:
* No GUI.
* When you start the script, you have five seconds to focus the your target window.
* Instead of your multiplier suggestion, the following script simply adds or subtracts 500 milliseconds from the current delay. Of course, you could change this to, say, 250, if you want more granularity.
* You can hover over the tray icon to see the current delay in milliseconds.
* Control+Escape will shut down the script.
--- Code: Autohotkey ---#SingleInstance, ForceSetBatchLines, -1SetControlDelay, -1DetectHiddenWindows, OnSetWorkingDir, % A_ScriptDirFileEncoding, UTF-8-RAW nDelay := 5000 ; Starting delay in milliseconds.Menu, Tray, Tip, % "Delay: " . nDelay " ms" Sleep, 5000 ; Five second delay to focus target window. Loop,{ SendInput, {PgDn} Sleep, % nDelay} Return ; End of auto-execute section. ^NumpadAdd:: ; Ctrl + Numpad+Plus key.^=:: ; Ctrl + equals/plus key.{ nDelay -= 500 ; Subtract 500 milliseconds from delay. Menu, Tray, Tip, % "Delay: " . nDelay " ms"}Return ^NumpadSub:: ; Ctrl + NumpadMinus key.^-:: ; Ctrl + dash/minus key.{ nDelay += 500 ; Add 500 milliseconds to delay. Menu, Tray, Tip, % "Delay: " . nDelay " ms"}Return ^ESC:: ExitApp ; Ctrl + Escape to kill the script.
Shades:
Imagine repeatedly pressing the Page-Down key. It can get old fast. Poor index finger.
-nkormanik (July 02, 2023, 01:56 AM)
--- End quote ---
Agree with you there about automatic scrolling.
My solution is/was both much more involved, but also simpler.
My take:
Really liking the Calibre software, but I found that keeping up the library between multiple computers is a bit of a hassle. And as browsers keep taking over my PDF viewer preferences (darned Edge!!!!) I thought, let's just see if there is an online version of Calibre that I can self-host. Guess what, there is indeed someone who did do this. As I have a spare desktop, I turned that into a Proxmox node. On that node I created a Linux VM (Ubuntu Server LTS, so no GUI of any kind). And then I followed the instructions from here: calibre-web
Actually, I have 2 spare desktops, the other one has the Proxmox Backup System installed onto it. This makes automated backups really simple. So I don't have to worry too much about messing the Calibre-web VM up or lose the books that are now stored inside it.
Automatic scrolling in a web-browser is already supported for years, so it is simply visiting the calibre-web instance in my LAN with a browser from any computer, enabling automatic scrolling, adjust the rate to one that is preferred at that moment and read at my leisure.
So you can see that my solution is way more involved, but also simpler...in a way.
On a somewhat related side-note:
Might even see if there is a (self-hostable) LLM out there that can "read aloud" the book by simply pointing it to the URL that calibre-web assigned to the book I want it to read to me. As sometimes I only have bandwidth enough (mentally) to listen to a book, while I'm doing something else. If listening to a book or almost any other type of documentation, professionally or otherwise, is more your thing, you could try and make the book(s)/document(s) you want to "hear" available to Google's NotebookLM.
It "ingests" the content and turns it into a podcast between 2 AI persons (male and female), which sound very convincing discussing the document(s) you provided.
Navigation
[0] Message Index
[#] Next page
Go to full version