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: DONE: Key combination tally  (Read 11,133 times)

ald4

  • Participant
  • Joined in 2009
  • *
  • Posts: 9
DONE: Key combination tally
« on: November 25, 2016, 07:36 PM »
I have a new job where I'm required to process a certain number of tickets per hour, but they don't tell you how many you've done at the time. They tell you later.

The keyboard shortcut to finish a ticket is Shift+Enter. I'd like a tally of how many times I've clicked Shift+Enter.



I thought I'd solve this myself using Sharpkeys to remap Shift+Enter to a single key and then find another bit of software somewhere to count how many times that key was pressed, but found Sharpkeys can't do a combination.

Would love an on-screen tally that could be onscreen all the time, like something that goes on top of other windows or displayed in the system tray.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,649
    • Participated in NANY Challenge Eleven Times
    • Coding Snacks
    • Linux User
    • Hardware Hacker
Re: DONE: Key combination tally
« Reply #1 on: November 25, 2016, 08:03 PM »
Sounds like a job for Skwire's KeyCounter
/Ton
Ath's software collection, Quote: "A problem well stated is a problem half-solved." (Charles Kettering)

ald4

  • Participant
  • Joined in 2009
  • *
  • Posts: 9
Re: DONE: Key combination tally
« Reply #2 on: November 25, 2016, 08:33 PM »
Sounds like a job for Skwire's KeyCounter

Just had a quick look. Looks like it can capture Enter fine but Not a combination like Shift+Enter.  :(

IainB

  • @Slartibartfarst
  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 7,544
Re: DONE: Key combination tally
« Reply #3 on: November 26, 2016, 01:43 AM »
Use AutoHotkey to detect/capture whatever key combo you desire, and then simply pass/send the relevant trigger key(s) to KeyCounter, or, you could write a key-counting routine in AHK instead - but then, why reinvent an otherwise presumably perfectly good wheel?

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: DONE: Key combination tally
« Reply #4 on: November 26, 2016, 01:45 AM »
Here's a quick'n'dirty AHK script to accomplish what you want.  It'll show the count in the window and the tray icon tooltip (hover the mouse cursor over the tray icon).  There's also a reset count option in the right-click menu of the tray icon.

Code: ( autohotkey)
Menu, Tray, Add
Menu, Tray, Add, Reset count, MenuHandler
Gui, 1: Margin, 1, 1
Gui, 1: +ToolWindow
Gui, 1: +AlwaysOnTop
Gui, 1: Add, Edit, w50 Center ReadOnly vedtCounter, 0
Gui, 1: Show, , % " "
Return


UpdCounter:
{
    GuiControl, Text, edtCounter, % myCounter
    Menu, Tray, Tip, % "Count: " . myCounter
}
Return


MenuHandler:
{
    myCounter := 0
    GoSub, UpdCounter
}
Return


~+Enter::
{
    myCounter++
    GoSub, UpdCounter
}
Return

IainB

  • @Slartibartfarst
  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 7,544
Re: DONE: Key combination tally
« Reply #5 on: November 26, 2016, 01:48 AM »
Snap.
Sorry, I should have waited for @skwire to respond.    :-[

antekgla

  • Participant
  • Joined in 2011
  • *
  • Posts: 75
    • Participated in NANY Challenge Once
Re: DONE: Key combination tally
« Reply #6 on: November 26, 2016, 12:46 PM »
Here's a quick'n'dirty AHK script to accomplish what you want.  It'll show the count in the window and the tray icon tooltip (hover the mouse cursor over the tray icon).  There's also a reset count option in the right-click menu of the tray icon.


So simple...
This drew my attention and I try to make something in Delphi... but try to monitor the keyboard in an application what dont have focus implies keyboard hooks, dlls, API Calls, Virtual Key Codes
This AHK script so simple... Don't have a SINGLE line of keyboard management, only the key combo searched...
Code: ( autohotkey)
~+Enter::
... and nothing more.

SRTFilter Automatic Subtitle Editor & Renamer
Dualcopy If you use Teracopy or Fastcopy this can be interesting   - My N.A.N.Y 2018 Entry
« Last Edit: November 26, 2016, 12:52 PM by antekgla »

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: DONE: Key combination tally
« Reply #7 on: November 27, 2016, 02:05 AM »
Did the script work for your purposes?  If so, I'll mark this request as done.

ald4

  • Participant
  • Joined in 2009
  • *
  • Posts: 9
Re: DONE: Key combination tally
« Reply #8 on: November 27, 2016, 08:16 PM »
Many thanks!

It's quite a while since I used AHK. I'll need to redownload it and familiarise myself with it again.

ald4

  • Participant
  • Joined in 2009
  • *
  • Posts: 9
Re: DONE: Key combination tally
« Reply #9 on: November 29, 2016, 01:01 AM »
Did the script work for your purposes?  If so, I'll mark this request as done.

Script works great!  ;D

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