AutoHotkey Community

It is currently May 25th, 2012, 11:17 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 145 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8 ... 10  Next
Author Message
 Post subject:
PostPosted: January 29th, 2008, 10:08 am 
Online

Joined: April 22nd, 2007, 6:33 pm
Posts: 1833
It does work:
Code:
Hotkey, ~Enter, HotkeyOK
Return

HotkeyOk:
MsgBox, Enter is showing this msgbox and is sending enter to the active window
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 29th, 2008, 10:12 am 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
tic wrote:
It does work


That's what I meant - sorry probably wasn't very clear - but how would
you prevent the Enter being sent to the active window?

If I'm typing notepad and and pressing Enter I just want
the "OK" button pressed in the GUI and not start a newline
in notepad.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 29th, 2008, 10:14 am 
Online

Joined: April 22nd, 2007, 6:33 pm
Posts: 1833
Sorry, I dont think I understand??:
Code:
Hotkey, Enter, HotkeyOK
Return

HotkeyOk:
MsgBox, Enter is showing this msgbox and isnt sending enter to the active window
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 29th, 2008, 10:29 am 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
You're right that does work. But (there is always a but isn't there)
when I do this in WB_Timer.ahk

Code:
Hotkey, ~Enter, HotkeyOK
It:
- Presses OK in the GUI
- Sends Enter to the active Window
--> not what I want
If I do this
Code:
Hotkey, Enter, HotkeyOK

I've disable my Enter key for all active windows when WB_Timer.ahk
is running (I'm on W2K)

So what would I need to do to:
- have Enter work in the GUI and not the active window
- Keep my Enter working while the script is running

I must be missing something very obivious :?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 29th, 2008, 10:55 am 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
I think I have solved it like so:
Code:
Hotkey, Enter, HotkeyOK


Code:
HotkeyOK:
If !DllCall("IsWindowVisible", "UInt", hwnd) ; if the GUI isn't visible just send the hotkey, that does mean the hotkey is blocked for all other active windows while the GUI is visible (e.g. you can press Enter in notepad while the GUI is visible, so it is still best to choose the hotkeys wisely)
   {
   Send, {Enter}
   Return
   }
If !End
   {
   Gui, 2: Hide
   Working := !Working, Time1 := A_TickCount
   SetTimer, UpdateTray, 250
   SetTimer, EndWorkBreak, % Working ? WorkTime*60*1000 : BreakTime*60*1000
   }
Return


Perhaps there is another/better way...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 29th, 2008, 11:00 am 
Online

Joined: April 22nd, 2007, 6:33 pm
Posts: 1833
oh i see what you mean. sorry its early for me :)

maybe something like this would work??

Code:
Hotkey, IfWinActive, ahk_id %hwnd%
Hotkey, Enter, HotkeyOK
Return

HotkeyOk:
MsgBox, Enter only sent to hwnd
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 29th, 2008, 11:11 am 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
I actually did try that with IfWinExist, but somehow it didn't work, perhaps because it is a hidden Gui? (I did add DetectHiddenWindows, on). I'll try again later...

You can't use IfWinActive because the GUI isn't active as far as I can tell.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 29th, 2008, 7:39 pm 
Offline

Joined: October 27th, 2006, 10:12 am
Posts: 649
Thanks to anyone who put their efforts into this solution. It's great, (when used together with ToDoList). So it's "just" an additional frontend to ToDoList with some extra features like slideshow (to me so far).

What I would change:
ESC for closing the entry windows (rather than Alt-c)
Ctrl-Enter for OK (rather than Alt-s)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 29th, 2008, 7:50 pm 
Offline

Joined: October 27th, 2006, 10:12 am
Posts: 649
automaticman wrote:
What I would change:
ESC for closing the entry windows (rather than Alt-c)
Ctrl-Enter for OK (rather than Alt-s)


That's what I'm using for it:
Code:
;; changing some hotkeys for ToDoList
GroupAdd, ToDoListGrp, Capture Task/Idea List ahk_class AutoHotkeyGUI
GroupAdd, ToDoListGrp, New Active Task ahk_class AutoHotkeyGUI
return

#IfWinActive, ahk_group ToDoListGrp
{
ESC::
{
  Send, {altdown}c{altup}
  return
}

^Enter::
{
  Send, {altdown}s{altup}
  return
}
}


Report this post
Top
 Profile  
Reply with quote  
PostPosted: February 2nd, 2008, 12:02 pm 
Offline

Joined: August 11th, 2007, 5:56 pm
Posts: 3
hi
it togles time recording in ToDoList if you dont
use mouse or keyboard defined time.

its in a alpha version and may you could make it better.
may you know SmartWorkTimeTracker, then you know what it wants to be ... maybe one time in future.


Code:

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

#SingleInstance force


; Stop time tracking with ToDoList
; with trick: restarting tool
; first save the currant:

SetTitleMatchMode,2
t= - ToDoList ® AbstractSpoon
IfWinNotExist, %t%
{
   tooltip,not exist
   sleep,5000
    exitapp
}
WinGetTitle, tFullFirst,%t%
SetTitleMatchMode,3
;ahk_class Afx:400000:b:10013:6:513063d
tooltip,save current 15
; ControlSend [, Control, Keys, WinTitle, WinText, ExcludeTitle, ExcludeText]
; ControlSend, , abc, cmd.exe  ; Send directly to a command prompt window.
WinActivate, %tFullFirst%
WinWaitActive, %tFullFirst%, ,2
Loop,90
{
  tooltip, save - %tFullFirst%
  star=*
  if star not in %tFullFirst%
    break
  ControlSend,, ^s , %tFullFirst%
  Sleep,100
  WinGetTitle, tFullFirst,%tFullFirst%
}
  tooltip, close current 17
ControlSend,, {CTRLDOWN}{ALTDOWN}c{ALTUP}{CTRLUP}, %tFullFirst%
Sleep,800
SetTitleMatchMode,2
WinGetTitle, tFullSecond,%t%
SetTitleMatchMode,3
IfWinNotExist, %tFullSecond%
{
   tooltip, %tFullSecond% not exist
   sleep,5000
  exitapp
}
tooltip, reload last - %tFullFirst% 202
Sleep,600
SetKeyDelay , 5, 5,InputThenPlay
Loop,90
{
  WinActivate, %tFullSecond%
  WinWaitActive, %tFullSecond%, ,2
  SetTitleMatchMode,2
  WinGetTitle, tFull2,%t%
  SetTitleMatchMode,3
  if tFull2=%tFullFirst%
  {
    ;msgbox, nice
    break
  }
  WinActivate, %tFullSecond%
  WinWaitActive, %tFullSecond%, ,2
  IfWinNotActive,%tFullSecond%
    continue
  Send,{ALTDOWN}f{ALTUP}
  ;ControlSend,, {ALTDOWN}rf{ALTUP}, %tFull%
  Sleep,500
    tooltip, reload last 23
  WinActivate, %tFullSecond%
  WinWaitActive, %tFullSecond%, ,2
  IfWinNotActive,%tFullSecond%
    continue
  Send, {Down 3}r ; reload last
  ;ControlSend,, {Down 3}r, %tFull% ; reload last
  Sleep,100
    tooltip, reload last 26
  WinActivate, %tFullSecond%
  WinWaitActive, %tFullSecond%, ,2
  IfWinNotActive,%tFullSecond%
    continue
  Send,{right}1 ; reload last
  ;ControlSend,,1, %tFull% ; reload last
}


;--------------------------------
   SetTitleMatchMode, 1
  WinGetTitle, guiT,TT
  tt=OFF
  guiTnew=TT %tt%
   SetTitleMatchMode, 1
  IfWinExist,TT
  {
     SetTitleMatchMode, 1
    WinSetTitle, TT, , %guiTnew%,
  }
;--------------------------------

SetTitleMatchMode, 3
t=dB CPUlight v0089 ahk_class AutoHotkeyGUI
WinClose,%t%
WinWaitClose,%t%
Sleep,200
run, dB_CPUlight_v0150.exe
Sleep,800
WinMinimize , %t%






Report this post
Top
 Profile  
Reply with quote  
PostPosted: February 10th, 2008, 2:37 pm 
Hello and a big thank you for this great script!
Would it be possible to make screenshots from a 2nd monitor as well?
Unfortunately I have no clue about AHK, otherwise I would try myself...
Thanks a lot!


Report this post
Top
  
Reply with quote  
PostPosted: February 25th, 2008, 4:05 am 
A few weeks ago I had no idea what this utility was, but now that I've been using it for just a few days I'm addicted. Here is a summary of experience and enhancement ideas so far - right or wrong, this is the way I understand things so far:

The tool is designed to be a work/break timer but for those of us who have never used such a thing it's coming in the door as just an excellent way to track time in conjunction with TDL. However, the way it works compels me to immediately start revising the way that I work so that I can benefit from the work/break concept. So in a way the main purpose sort of infects our work habits - but in a very good way!

Initially, and I'm still fighting this, I don't like some program popping up while I'm working, telling me it's time to take a break. Then again, that's the purpose. As I sit here with sore eyes from staring at a monitor too long I realize I really do need to take more breaks, so I'm starting to follow the cues. It's taking me a while to tune it to my liking - I'm more of a 26-4-16 kind of guy, rather than a 10-2-5 or 48-12-3.

As far as enhancements, here are some ideas so far.

- Allow for a reset on the hour in order to get breaks at regular times as well as regular intervals. I sort of like the idea of knowing exactly when I'll be breaking from one effort or another and letting people know exactly when I'll be able to break.

-When changing the settings, allow the new settings to take effect immediately. As it is I think you need to close down the program or wait for the current cycle to finish before it starts with new settings.

- Add ability to associate time blocks with specific kinds of activity. We don't need to follow this all the time but the guideline can help us to remember what we should be doing at specific times and get us back on track, continuing related activity in the next cycle. Examples of regular activity include:
--- Reading news/forums.
--- Lunch
--- Real work
--- Email
--- Open discussion time

- For time keeping (again, a perhaps unintended but yet primary use of this utility) it would be nice to see the following in the task entry popups:
--- Pulldown for client or department codes - general, not too many. (Yes, I suppose we already have a freeform field for this but I find myself entering non-standard codes almost every time I type something in there.)
--- Checkbox for billable.
These can be added by the code at the back-end of the comments, delimited by pipes: otherdata|comments|code|billable

-Sound for timer should be selectable, with one check for break start and another for break end. We're right at the keyboard so we probably don't need audio for break start, the visual cue is good enough. And we might be away from the keyboard during break, so we probably do need audio for break end.

- Allow playing an audio (WAV, MPEG, AU) file rather than a pre-defined sound. I should get familiar with AHK and add this one for myself.

- Allow for a configurable ASCII character that replaces embedded carriage returns. Multiple lines in comments mess up exports but if we can control the delimiter we can zap that into CRLF later.

I raised a couple points in there, first on the pipe delimiter and then on maintaining my own code.

We can easily just put a pipe into our comments to add new fields for ourselves. So if I want a billable flag all I need to do is put " |b " after the comment. Then when the data is imported into Excel there will be a new column for billable items. Kewl, eh? You guys probably do this all the time. :oops:

Finally, I understand that this is open source freeware and while I'm familiar with a ton of programming languages and environments, AHK isn't one of them ... yet. The usefulness of this tool (which I refer to as WBT along with TDL) is compelling enough to make me take interest in this AHK thing so that I can maintain my own code, make my own enhancements, and hopefully give changes back to the group - I just need to find some time, which is why I took interest in WBT in the first place. :) So as a marketing tool this thing is great. It makes me wonder what else is out there in AHK-land that can be used. I'll definitely be looking at it soon.

Anyway, thanks for your time here. And thanks for some great software!

(sorry for the -- dashes -- the List BBCodes don't seem to be working)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 25th, 2008, 6:55 am 
Offline

Joined: January 22nd, 2007, 11:24 pm
Posts: 206
Location: CO, USA
Hi Starbuck,

Thank you, more than you know, for the time and effort put into your comment. My focus of recent has been on family and health matters. I've been very neglect on this forum of recent. However, your post motivates me to re-focus some of my time back to WBT.

I'll address your post, in detail, as my first to do on my daily action list (after my doctor appt) tomorrow. Just wanted to give a quick "thank you" now.

P.S. From your post, I can't help but feel our paths have (or should have) crossed? You signed in as a guest so no way to PM you. Hope you rethink signing up as a member of this forum.
P.S.S. The're other posts, deserving a response, I'll be responding to as well. Thx. in advance to everyone who's taken the time to show interest and support in WBT!!

_________________
Lars


Report this post
Top
 Profile  
Reply with quote  
PostPosted: February 26th, 2008, 9:17 am 
Offline

Joined: January 22nd, 2007, 11:24 pm
Posts: 206
Location: CO, USA
BlackLight wrote:
Hello and a big thank you for this great script!

Thanks, my pleasure.
BlackLight wrote:
Would it be possible to make screenshots from a 2nd monitor as well?

Honestly, I don't know. Tic, or others far more knowledgeable than me, is this possible?

_________________
Lars


Report this post
Top
 Profile  
Reply with quote  
PostPosted: February 26th, 2008, 9:43 am 
BlackLight wrote:
Would it be possible to make screenshots from a 2nd monitor as well?

The original ScreenCapture script
http://www.autohotkey.com/forum/topic18146.html
used
Code:
SysGet, Mon, Monitor, 1

Looks like someone modified it while copying it.
You may use for second monitor instead
Code:
SysGet, Mon, Monitor, 2


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 145 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8 ... 10  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Stigg, tic and 12 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group