forum

Key presses per second program

posted
Total Posts
184
Topic Starter
Roan

Keys per second

Update note: You can now also track mouse buttons

So I wanted to know how many keys / second I pressed in osu! And I had already seen programs like this on streams.
I could however not find a program that worked on my computer so I decided to write one myself.

The program when active looks like this:



Accessible by right clicking on the program.

For each configured key it shows how many times it is pressed. By default it also shows the maximum, average and current number of keys pressed per second.
When enabled it can also show a graph of the number of keys pressed per second over time. The horizontal line in the graph represents the average number of keys pressed per second.

Everything shown in the picture above can be toggled on or off and all the panels can be arranged in a lot of different ways.

Lastly, there are also some commands that can be sent to the program:
Ctrl + P: Causes the program to reset the average and maximum value.
Ctrl + U: Terminates the program
Ctrl + I: Causes the program to reset the key press statistics.
Ctrl + Y: Shows / hides the GUI.
Ctrl + T: Pauses / resumes the counter.
Ctrl + R: Reloads the configuration file.

You can also move the program using the arrow keys this makes pixel perfect positioning possible :D .
Well I hope some of you find this program useful and/or will use it for your streams (I would love to see that happen :) ).
And if you find any bugs feel free to report them.

Notes

- The horizontal line in the graph represents the average number of keys pressed per second.
- You can add any key, and any number of keys to the program.
- You can also track mouse buttons with this program.
- The overlay option is far from perfect, it just asks the OS to place the program on top. It'll not overlay most full screen games.
- To change a GUI colour in the colours menu, click on the current colour
- An opacity of 100% means completely opaque and an opacity of 0% means completely transparent.
- The snap to screen edge function works on multi-monitor setups.
- You can move the window with the arrow keys at 3 different speeds 1, 2 & 3 pixels at a time (2=Ctrl, 3=Shift).
- You can pass the path to the config file to load via the command line or a shortcut so you can skip the configuration step. Setting the program as the default program to open the configuration file with may work as well as long as you don't move the executable afterwards.
- When resetting something it will also be printed to the console if this program is running using cmd/shell.
- For some people running the program in Windows 98 / ME compatibility mode makes it so it can overlay full screen osu! so if you're lucky this might work.
- If you have an old configuration file (kpsconf1 or kpsconf2) then you need to convert it with version 8.4 to load it in more recent versions.

Updates

See the changelog on GitHub.

Downloads

(Java 8 required, supported operating systems: Mac (tested 10.11.6 & M1), Linux (tested Ubuntu 16.04 LTS) & Windows (tested 7, 8, 10 & 11))
Windows executable
Runnable Java Archive

All releases: link
GitHub repository: KeysPerSecond
awsumturtle
.
KevinWalker
Whoa, nice job man. but, can this program used at mania?
Topic Starter
Roan

swem8 wrote:

Thanks man looking these from everywhere now you made a one thank you you are awesome but how do i apply it to see it on osu?
Idealy you would have a second screen to put it on or check it ocassionally. However I might be able to make it so that it is rendered on top of osu! so I'll experiment with that. It might not work though if osu! forces itself to be the top window. In that case you'd have to disable full screen mode. I'll get back to you once I've figured something out.


SDVX KevinKun wrote:

Whoa, nice job man. but, can this program used at mania?
You can add any key, and any number of keys to the program. So yes it can be used for mania ^^

Edit
I've updated the program and added the option to overlay the osu! window. This will however only work if osu! isn't being run in fullscreen mode (filling the entire screen is fine but the fullscreen option has to be off). Therefore this isn't an ideal solution, there is however no real solution because when I force my program to be the top window when osu! is running in fullscreen mode, osu! minimizes. If someone has a beter idea I'd love to hear it though.
Mustaucheman
Amazing job here, is there any way to make the graph/cur update faster?
Topic Starter
Roan

Mustaucheman wrote:

Amazing job here, is there any way to make the graph/cur update faster?
Yes that would be possible. I'll try to implement a variable update rate as soon as possible. :)

Edit
Implemented, CPU usage still seems to be reasonable even with relatively high settings I wouldn't go to crazy though xD. I do agree however that the program looks a lot smoother and active like this. There is now a button on the config screen that can be used to change the update rate to a value between 1000ms and 10ms. I also changed the 'terminate program' key to Ctrl + U since I forgot that Ctrl + O opens the options menu in osu! so I'd ocasionally terminate the program by accident.

Love these ideas :) please don't hesitate to suggest more features ;)
Agrrox
is there way to rearrange key order ?

edit: it seems to launch on mac, will test if it works with wine version of osu, overlay doesnt work for mac.
Topic Starter
Roan

Agrrox wrote:

is there way to rearrange key order ?

edit: it seems to launch on mac, will test if it works with wine version of osu, overlay doesnt work for mac.
There is currently no way to change the key order. I'll implement it as soon as I have some time. Also thank you for testing the program on a mac :)

Edit
Implemented! :) You can now change the position of the keys in the 'add key' window. The keys are then ordered from lowest value to highest value (negative values & skipping indices is allowed).
This information is ofcourse also saved if you save your settings. The only disadvantage of this is that configuration files generated with older versions of the program can no longer be read >.< I'm sorry :( .
Agrrox
Also to the interface... i think it will be better to invert the color of background and key, so its always visible when pressed. nice program :D
Topic Starter
Roan

Agrrox wrote:

Also to the interface... i think it will be better to invert the color of background and key, so its always visible when pressed. nice program :D
Thank you :) , do you mean that when a key is pressed I should change the text color to black? If so I'll implement that as soon as I have some time, since that seems like a useful feature ;) .

Edit
Implemented! The color of the text now turns black when the key is pressed, this way the text on a key is always clearly readable :) . And thanks again for your feedback ;) .
NightNarumi
Woah, this seems really interesting, gonna try this out tomorrow :p
Topic Starter
Roan

NightNarumi wrote:

Woah, this seems really interesting, gonna try this out tomorrow :p
Thanks :)
Agrrox
looks much better to me :)

can you implement ability to change colour? that would be cool to be able to change this.
Topic Starter
Roan

Agrrox wrote:

looks much better to me :)

can you implement ability to change colour? that would be cool to be able to change this.
:)
Sure I'll implement an option to change the colour as soons as possible (probably later today within ~6 hours).

Edit
Implemented! You can now change the GUI colours in the new colours menu. Both the foreground and the background colours can be changed, don't go too crazy because some colours are just not meant to be used together xD. Also this update shouldn't break previously saved configurations :) .

Edit 2
I thought of some extra features myself so I updated and added those in. You can now track all the keys on you keysboard without having to add all of them (they are not added to the graphical display though since it probably wouldn't fit on your screen, you can still add the keys you want to have displayed, but all of them will be tracked). And I added the option to hide the tracked keys so now it's possible to show just the avg, max, or cur or any combination of them. And it's now also possible to show only the graph. And there are also some optimization & fixes, but you're probably not interested in that anyway. :)

Edit 3
Whilst watching a stream I saw that the total number of hits wasn't being displayed correctly when it reached over 10k. So I fixed that. And while at it I also added support for hiding individual tracked keys. So now you can have keys counting towards your stats whilst they are not being displayed. :)

Edit 4
On request I added the option to remove added keys. Useful if you added a wrong key :) .
Mizyx
I think it would be great if you added opacity :D, cause some users could play better with it on :)

Edit:
Also resizable will be great too :oops:
iloveyou4ever
This is a very nice program :D
But can you add the function to show the 1 demical digits for the key per seconds?
I think it would be better :D
Thanks
Worst Mouse Aim
You can get that by external programs... I guess the reason is streaming?
Topic Starter
Roan

Mizyx wrote:

I think it would be great if you added opacity :D, cause some users could play better with it on :)
Sounds like a very nice feature :D . However it's not all that easy to implement :o . I put it on my todo list but I have no idea how long it will take me :/

iloveyou4ever wrote:

This is a very nice program :D
But can you add the function to show the 1 demical digits for the key per seconds?
I think it would be better :D
Thanks
Thanks and I'll implement that asap :)

Worst Mouse Aim wrote:

You can get that by external programs... I guess the reason is streaming?
Not exactly sure what you mean. But the reason I made this is because it's 'live'.

Edit
Added the option to display decimal avg & cur values. Also added a command key to show / hide the GUI (Ctrl + Y). :)
Still working on the other features. ;)

Edit 2

Mizyx wrote:

Edit:
Also resizable will be great too :oops:
:) yeah I think that would be great too. It's not really an easy thing to implement though xD. But I've put it on todo. I'll have most likely have both of your features finished by the end of the weekend :D.

Edit 3

Mizyx wrote:

I think it would be great if you added opacity :D, cause some users could play better with it on :)
Implemented! :) . In the colours menu you can now change the opacity of the foreground colour and the background colour ;) .

Edit 4
Implemented a little feature that allows the program to check for the latest version. So you no longer have to check this thread for updates :) (was there even someone who was doing that xD).

Edit 5

Mizyx wrote:

Edit:
Also resizable will be great too :oops:
Implemented :) , although I have to say that the program doesn't look as good in some sizes as it does in the default size. Especially upscaling makes some pixels more noticable :o . Might try to improve upon that in the future. :D
Zard0Z
This looks good. :3
Topic Starter
Roan

Zard0Z wrote:

This looks good. :3
Thanks :3
spukystar
nice
Topic Starter
Roan

spukystar wrote:

nice
Thanks ^^
Agrrox
I'm getting input conflicts when using KeysPerSecond with beatoraja BMS player(Be-Music Script). Input is delayed or not registering my presses when using both programs at same time.

https://github.com/exch-bms2/beatoraja
Topic Starter
Roan

Agrrox wrote:

I'm getting input conflicts when using KeysPerSecond with beatoraja BMS player(Be-Music Script). Input is delayed or not registering my presses when using both programs at same time.

https://github.com/exch-bms2/beatoraja
That's indeed a little weird. I tried to reproduce the conflict however I can't read about 95% of beatoraja's interface xD. So I managed to run the program, but I am completely lost when it comes to importing songs.When using the search field in beatoraja my key presses are registering though.

The only guess I can make that might be the issue is that beatoraja or the native library used by KeysPerSecond is consuming the key presses instead of only registering them. But that could also be wrong :/

So I am looking into the issue although I might have to learn Japanese first XD.
Micha ohne el
Huh, I actually like this little program a lot, but it has some bugs and other weird stuff I want to point out!

Oh man, I hope I wasn't to nitpicky with you here :/
Again, I really like this program, at least the idea is fantastic, but these are the things I came across the first hour or so of testing.
I'm not expecting you to fix all of them, but at least read through these and consider it :^)


  • 1. (ironically) It doesn't launch when the path of the executable (or the jar) contains a "!"... which is bad... in a game, that's called "osu!"...
    I moved the file to "D:\system\osu!" and it didn't work, in "D:\system\" however, it did! So, that's a bug, i guess.

    2. The option "Overlay osu!" is (well irrelevant, who would not want it to overlay osu!? But also) not working when osu!'s in fullscreen.

    3. It drains the performance way too much for what it's doing. For me, at a refresh rate of 1000 ms, it has almost the same CPU load as osu! itself at an unlimited frame rate (usually around 700-1500 fps). Even on 125 ms I still experienced lag spikes in osu!. But at least there's a simple solution for that: Just don't ever fucking use Java for real-time processing. Use C#, C++, Python, even fucking AutoHotkey if you like, but not Java...

    4. I don't know what caused it and it doesn't happen anymore, but at first, while playing, the program was constantly lighting up in the taskbar as if it had a notification for me.


And here are a few feature requests I have:


  • 1. Making an installer, rather than a standalone file. It would be easier to manage the config file, since it could be loaded automatically.

    1.5 Also right now the Load Config and Save Config windows always default to the documents folder. With an installer you could have it remember where the last file was loaded from.

    2. Saving the position of the overlay in the config file. (And/Or making it easier to position, like by snapping to the edges of the screen)

    some minor things left:

    1. Maybe do the opacity in percent, would be easier for the users, I think.

    2. The adding of keys is weird. Dunno. It works perfectly fine, but it's weird >.< Maybe make a window pop up and have the user then press the key, not before pressing the button! o:

    3. The config files could just be ordinary .cfg-files. Right now, you can't even edit them by hand (what I really like to do).

    4. Make the overlay right-clickable (I'm kind of influenced by Rainmeter here, it does that really nicely). At least for maybe exiting, pausing the counter, etc. this function could be very useful.


Aaaaaand that's it!

Wow, what a long list D:

I know, some of these are not easy to fix, for example the performance thing, when you only know Java, or the "Overlay osu!" thing, because osu!'s a dick and it always wants to be on top of everything.
I hope, you at least understand what I mean with those things c:

Obviously, if you have questions, or you fixed something, let me know! I would love to see this program on my screen every day :P

I hope, I could help you with this feedback :3
Topic Starter
Roan

SALZKARTOFFEEEL wrote:

Huh, I actually like this little program a lot, but it has some bugs and other weird stuff I want to point out!

Oh man, I hope I wasn't to nitpicky with you here :/
Again, I really like this program, at least the idea is fantastic, but these are the things I came across the first hour or so of testing.
I'm not expecting you to fix all of them, but at least read through these and consider it :^)


  • 1. (ironically) It doesn't launch when the path of the executable (or the jar) contains a "!"... which is bad... in a game, that's called "osu!"...
    I moved the file to "D:\system\osu!" and it didn't work, in "D:\system\" however, it did! So, that's a bug, i guess.

    2. The option "Overlay osu!" is (well irrelevant, who would not want it to overlay osu!? But also) not working when osu!'s in fullscreen.

    3. It drains the performance way too much for what it's doing. For me, at a refresh rate of 1000 ms, it has almost the same CPU load as osu! itself at an unlimited frame rate (usually around 700-1500 fps). Even on 125 ms I still experienced lag spikes in osu!. But at least there's a simple solution for that: Just don't ever fucking use Java for real-time processing. Use C#, C++, Python, even fucking AutoHotkey if you like, but not Java...

    4. I don't know what caused it and it doesn't happen anymore, but at first, while playing, the program was constantly lighting up in the taskbar as if it had a notification for me.


And here are a few feature requests I have:


  • 1. Making an installer, rather than a standalone file. It would be easier to manage the config file, since it could be loaded automatically.

    1.5 Also right now the Load Config and Save Config windows always default to the documents folder. With an installer you could have it remember where the last file was loaded from.

    2. Saving the position of the overlay in the config file. (And/Or making it easier to position, like by snapping to the edges of the screen)

    some minor things left:

    1. Maybe do the opacity in percent, would be easier for the users, I think.

    2. The adding of keys is weird. Dunno. It works perfectly fine, but it's weird >.< Maybe make a window pop up and have the user then press the key, not before pressing the button! o:

    3. The config files could just be ordinary .cfg-files. Right now, you can't even edit them by hand (what I really like to do).

    4. Make the overlay right-clickable (I'm kind of influenced by Rainmeter here, it does that really nicely). At least for maybe exiting, pausing the counter, etc. this function could be very useful.


Aaaaaand that's it!

Wow, what a long list D:

I know, some of these are not easy to fix, for example the performance thing, when you only know Java, or the "Overlay osu!" thing, because osu!'s a dick and it always wants to be on top of everything.
I hope, you at least understand what I mean with those things c:

Obviously, if you have questions, or you fixed something, let me know! I would love to see this program on my screen every day :P

I hope, I could help you with this feedback :3
Euh I'm kinda short on time right now so I'm only going to answer some points right now :3
I'll update this post tomorrow when I have some more time :D

Bugs:

1. This is really interesting, lol.

2. I'm aware of this 'bug'. But it's not something I can fix. Well I tried but that didn't really work out. Since when I set my program to 'always on top' mode it's always competing with osu! for being to top most window. So in the end neither program was working like it should :cry: But when you run osu! with the fullscreen option off (resolution can be fullscreen though). osu! doesn't try to be the top window so then it works. That however also adds extra lag for some :/

3. Real time processing is done in C actually. And on my old laptop (Intel Centrino CPU) it only takes 0~2% CPU (Firefox takes 10~50%). What really takes most of the CPU is the graph. But even so on my laptop that also only takes 2~4% CPU (slowest update rate 1000ms). Also Java isn't slow anymore besides I like Java for being cross-platform. It is a little weird though that the program seems to take that much CPU power for you.

4. It should only do that if the window was made visible again. So either on starup or when pressing Ctrl + Y. I'll see if I can replicate it though.

Features:

1. I personally really dislike installers. Since I like being able to drag my programs from computer to computer. As for the config part that is also possible without the program being installed, so I might look into that. But I'll make it optional for sure, since I for example have multiple config files for different mania modes and standard mode. Another option would be to associate the extension with the program so that you can just open the config files automatically. But that would require that you don't move the program to a different location. Hmm, this one is a little difficult xD

1.5 Also posible without an installer :P

2. I could make it snap to the edges of a screen but that would be troublesome for user that have multiple monitors. I think I'll just add a 'snap' option in the command menu I'm going to add for feature #4.

1. I didn't do it in percentages O.O shame on me..... >.<

2. Yup I totally agree the addition of keys is weird :) so weird that I always mess up myself..... Adding another option dialog would be possible. But I thought that the GUI was already preatty dialog heavy. If that's not an issue then I'll just make another dialog for it.

3. Hmm.... technically they could be. But currently they are serialized objects. Which is really really really convenient for me since I can load them really easy xD. Making them text based would be possible, but it would also be a lot of work, I'll see though if I'm in the mood I might do it ;)

4a. I should be able to implement this quite easily as soon as I have some time.

4b. Todo: pause functionality xD since that currently doesn't exist.

Anyway thank you for the feedback :) much appeciated.
I am going to put everything on my todo list however I currently don't have much time so I don't know when I'll be able to work on this.

Item / Status / Published
1. / Investigating / -
2. / Impossible / n/a
3. / Major improvements made / Published
4. / Todo / -
1. / Need a concrete idea / -
1.5 / Todo / -
2. / Todo / -
1. / Implemented / Published
2. / Todo / -
3. / Todo / -
4. / Todo / -

Edit
Thanks to your performance concerns I was able to find a major issue xD. Turns out that there was still some very old code left that was ultra inefficient, so please blame me for this and not Java >.<. Problem was that it would become exponentially more inefficient on a faster computer, so that's why I didn't really notice it. So I've changed it and on my computer the program now uses about 20 times less CPU xD. Plus I also improved the accuracy of the counter. So thank you very much for pointing this out :) The new improved release is published now by the way (v4.0). Still working on the other points.
show more
Please sign in to reply.

New reply