topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday April 18, 2024, 3:01 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: DONE: Pausable timer  (Read 7445 times)

rgdot

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 2,192
    • View Profile
    • Donate to Member
DONE: Pausable timer
« on: October 03, 2011, 05:59 PM »
I am looking for a timer that is pausable. But also has a separate hotkey or button that pastes the current elapsed time (to the second) into an 'internal' or external text editor. After pasting it the focus moves to after the pasted time ready for me to type things. Would be great if it can also paste the current date but that is of course available in text editors so it's not very important.

If this makes sense (?) is it doable? or something like this exists already?

Thanks :)

Paul Keith

  • Member
  • Joined in 2008
  • **
  • Posts: 1,989
    • View Profile
    • Donate to Member
Re: DONE: Pausable timer
« Reply #1 on: October 04, 2011, 12:04 AM »
This would be cool if it can be implemented in some type of launcher IMO like FARR.

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,288
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: DONE: Pausable timer
« Reply #2 on: October 04, 2011, 03:42 AM »
I am looking for a timer that is pausable. But also has a separate hotkey or button that pastes the current elapsed time (to the second) into an 'internal' or external text editor. After pasting it the focus moves to after the pasted time ready for me to type things. Would be great if it can also paste the current date but that is of course available in text editors so it's not very important.

If this makes sense (?) is it doable? or something like this exists already?

Thanks :)

See the attached file.

* PasteyTimer.exe (165.5 kB - downloaded 435 times.)

Screenshot:

Screenshot - 2011-10-04 , 7_34_25 PM.png

It doesn't do the date though.

Also, it's not polished.

* Currently the hotkey accelerator settings are not saved between runs.
* The clipboard is used as well, so when you paste, your clipboard has that data on it.
* It only shows hours, minutes, seconds. No attempt to do days, etc.

I've set it to be easy to use with your left hand. i.e. Use Z and X to start/stop. That way you can do it 1-handed. Sucks for lefties though...

It's .NET 4 Client Profile, so you need .NET 4 installed. (Sorry - had it finished before I realized that my defaults are for .NET 4, and not .NET 2.) Shouldn't be a problem though.

But, it does what you've asked for.
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

rgdot

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 2,192
    • View Profile
    • Donate to Member
Re: DONE: Pausable timer
« Reply #3 on: October 04, 2011, 09:23 AM »
@Renegade, thank you very much :up: .NET is no problem. Running it and pasting into Notepad, works great.

Just a couple of things that are not a problem for me but just to look, the timer thing happened when I clicked stop twice in a row by mistake. The other is pasting into Notepad++ (language either php or normal text).

pastey.jpg


Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,288
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: DONE: Pausable timer
« Reply #4 on: October 04, 2011, 11:43 AM »
@Renegade, thank you very much :up: .NET is no problem. Running it and pasting into Notepad, works great.

Just a couple of things that are not a problem for me but just to look, the timer thing happened when I clicked stop twice in a row by mistake. The other is pasting into Notepad++ (language either php or normal text).
 (see attachment in previous post)


Yes - I was aware of the double-stop issue. It has to do with time calculations since Unix 0 time (I calculate time based on ticks). I didn't bother fixing it because I wanted to get it done quickly.

For Notepad++, offhand I don't know why that would be. However, I must admit that I did use the "cheap" method of sending text to the 3rd party application. Again, that was in the interests of time. Doing it "right" would take me a day or so. I only tested in Skype and Editplus, and they worked fine. I never tested in Notepad++ or any other applications. :(

(Having looked into the problem further, the solution seems to be to use the native method keybd_event in user32.dll to send data. A bit more to it than that, but... that goes from 1 line of code to 1,000 lines of code...)

To get around the Notepad++ problem, you can focus on anything that doesn't accept text input, press hotkey + V, then in Notepad++ do a normal paste. That relates to the lack of "polish" I posted above where the clipboard is used and the data remains on the clipboard.

If nobody objects, I'll post the source code under a "don't complain" license. :P ;D i.e. Yes. There is room for improvement. And no, I'm not looking for criticism on something that I slapped together very quickly to get a job done. :P

That way anyone that is interested and has time can do some polish for it. (It wouldn't be hard -- the code is nice and clean with some comments -- it might be a good learning exercise for anyone interested in improving their C# skills.)

Sorry there -- I'm just under the gun with a few things that I have to get done. :(


Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

rgdot

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 2,192
    • View Profile
    • Donate to Member
Re: DONE: Pausable timer
« Reply #5 on: October 04, 2011, 12:47 PM »
I understand. It works for me so it's fine for me at least. I will try the alternate method for Notepad++. Thanks.