ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

Key counting script

(1/6) > >>

Robby250:
Hi there,

I was led to this forum after searching on the internet for a key counting software, to be exact at skwire's Keycounter discussion page. There I reported a few issues with the software and he replied that those cannot be resolved due to the limitations of Autohotkey; then gave me a simple script for keycounting I could work on. Here's the script:

Are you familiar with AutoHotkey programming at all?  If so, here's a quick snippet I wrote that will do what you want for letters a-z and numbers 0-9.  Press F1 at anytime to see a simple message box showing your keystroke stats.  You could easily extend this to cover all keys, to save/load data, display data in a more elegant way, etc.-skwire (August 20, 2011, 03:11 PM)
--- End quote ---

Now, I thought that it would be better if I took the script out of the quote:


--- Code: Autohotkey ---myKeys := "abcdefghijklmnopqrstuvwxyz1234567890" ; Iterate through myKeys variable and create a hotkey for each letter and number.Loop, Parse, myKeys{    Hotkey, ~*%A_LoopField% up, CountKeys, On} Return ; End of auto-execute section.  CountKeys:{    ; Get the third character from the left of the hotkey name.    StringMid, myKey, A_ThisHotkey, 3, 1        ; Increase character counter and total counter.    %myKey%_Count++    Total_Count++}Return F1::{    ; Null out report variable.    myReport := ""        ; Iterate over myKeys variable and build out report, key by key.    Loop, Parse, myKeys    {        myReport .= A_LoopField . ":`t" . %A_LoopField%_Count . "`n"    }        ; Display report with total at the bottom.    MsgBox, % myReport . "`nTotal:`t" . Total_Count}Return
Unfortunately, I do not know any Autohotkey programming, and I basically want this to cover the whole keyboard, auto save the counter data and load it on script startup.

The reason of why I want this is because I am getting a new keyboard soon and I want to track each keypress individually and total, out of curiosity. If it matters (for which keys to add to the counter), I will be getting a Razer BlackWidow: http://tbreak.com/tech/files/DSC00056.jpg

The initial issues I found with KeyCounter and I do not want to happen are: repeated keys (e.g. holding W for 5 seconds, it repeats the key many times) were being taken in consideration by the KeyCounter. I only want a single keystroke count; and keys combined with a modifier (e.g. alt+2; ctrl+shift+E, etc.), the modifier was being counted but the key(s) under the modifier were not. I wish they were.

skwire,
Thanks for this snippet, I replied at KeyCounter's discussion thread, but you probably did not see the post, were too busy, or whatever the reason is, it does not matter, but I think that you are reading the forums you are moderating :).

EDIT: Ah, I just saw the "Post New Requests Here" page, was I supposed to make the thread there? I am sorry.

skwire:
@Robby250: I went ahead and moved your post so no worries.  Apologies for the lack of reply on the KeyCounter thread.  I've been crazy busy with work the past couple of weeks so I haven't had much time to reply.  I can probably find time next week to flesh out that snippet I gave you.  If you don't mind, and to save me time, I'd like to just write it without a GUI.  In other words, you would simply view the data in any text editor.  It will be saved/loaded across sessions, though.  Would that be okay?

Robby250:
Yeah, that is fine, but can it auto save when the script is shutting down (computer shutdown), or can it only save ocasionally, and the data in between saves is lost? I would like it to be as accurate as possible. :p

skwire:
Yeah, that is fine, but can it auto save when the script is shutting down (computer shutdown), or can it only save ocasionally, and the data in between saves is lost? I would like it to be as accurate as possible. :p
-Robby250 (August 25, 2011, 02:40 PM)
--- End quote ---

Auto-saving on computer shutdown can be hit-or-miss.  So, sure, I can make it auto-save every X number of seconds.  What are you comfortable with?  Ten seconds?  Thirty?

Robby250:
If it doesn't produce any performance issues I'm good with even less than 10 seconds. Also, by auto-saving I meant that the script detects when it is being turned off and saves... or something like that ¯\(°_o)/¯.

Navigation

[0] Message Index

[#] Next page

Go to full version