 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
HotKeyIt
Joined: 18 Jun 2008 Posts: 2190 Location: GERMANY
|
Posted: Wed Jan 28, 2009 6:36 pm Post subject: |
|
|
Many thanks Micha for you work, it is really appreciated. I can finally use my ppc much faster and much more convinient.
Here a PPC version of RapidHotkey(), it is really a must for PPC.
Using RapidHotkey you canīlaunch different labels or keystrokes using multiple presses of one key.
| Code: | RapidHotkeyPPC(keystroke, times="", delay=0.4, IsLabel=0)
{
;Suspend, On
Pattern := Morse(delay*1000)
If (StrLen(Pattern) < 2 and Chr(Asc(times)) != "1")
Return
If (times = "" and InStr(keystroke, """"))
{
Loop, Parse, keystroke,""
If (StrLen(Pattern) = A_Index+1)
continue := A_Index, times := StrLen(Pattern)
}
Else if (times > 0 and InStr(keystroke, ""))
{
Loop, Parse, keystroke,""
If (StrLen(Pattern) = A_Index+times-1)
times := StrLen(Pattern), continue := A_Index
}
Else if InStr(times, """")
{
Loop, Parse, times,""
If (StrLen(Pattern) = A_LoopField)
continue:= A_Index, times := A_LoopField
}
Else if (times = "")
continue := 1, times := 2
Else if (times = StrLen(Pattern))
continue := 1
If !continue
Return
Loop, Parse, keystroke,""
If (continue = A_Index)
keystr := A_LoopField
Loop, Parse, IsLabel,""
If (continue = A_Index)
IsLabel := A_LoopField
If !IsLabel
Send % keystr
else if IsLabel(keystr)
Gosub, %keystr%
Return
}
Morse(timeout = 400) { ;by Laszo -> http://www.autohotkey.com/forum/viewtopic.php?t=16951
tout := timeout/1000
StringReplace, key, A_ThisHotkey, *
StringReplace, key, key, ~
StringReplace, key, key, $
StringReplace, key, key, #
StringReplace, key, key, +
StringReplace, key, key, !
StringReplace, key, key, ^
Loop {
t := A_TickCount
KeyWait %key%
Pattern .= A_TickCount-t > timeout
If(ErrorLevel)
Return Pattern
KeyWait %key%,DT%tout%
If (ErrorLevel)
Return Pattern
}
} |
_________________ AutoHotFile - ToolTip(n,text,title,options) |
|
| Back to top |
|
 |
Donny Bahama
Joined: 30 Dec 2006 Posts: 132 Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
|
Posted: Mon Mar 23, 2009 6:01 pm Post subject: InputBox broken? |
|
|
After days of banging my head against a brick wall, I finally figured out why my script works with AHK but not AHKCE... It seems InputBox is broken.
Or is there something wrong with my code?
| Code: | InputBox, var1, Title, Prompt
MsgBox You entered %var1%
|
The above code returns nothing when user input is entered. Works fine on (desktop) AHK. |
|
| Back to top |
|
 |
Donny Bahama
Joined: 30 Dec 2006 Posts: 132 Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
|
Posted: Mon Mar 23, 2009 8:42 pm Post subject: Why won't this work? Workaround? |
|
|
I'm trying to set the focus to the GUI Edit control (so I don't have to click in it before I start entering the text. The following code works in AHK (desktop)
| Code: | Gui, Add, Text, w180, Text to search for?
Gui, Add, Edit, +Tabstop r1 w180 vFindTxt
Gui, Add, Button, center gFindNow, OK
Gui, Show, center w200, Find Item(s)
send, {tab}{tab}
return |
I also tried using MouseClick (in place of the Send, {tab} statement) but it was ignored. I'm not sure how to use ControlFocus, but I suspect it won't work because Send and MouseClick don't. The only other means I know of is using GuiControl Focus, but GuiControl isn't supported.
Anybody done this successfully? Any suggestions for setting the focus to the Edit control? |
|
| Back to top |
|
 |
Micha
Joined: 15 Nov 2005 Posts: 500 Location: Germany
|
Posted: Tue Mar 24, 2009 9:01 pm Post subject: Re: InputBox broken? |
|
|
| Donny Bahama wrote: | After days of banging my head against a brick wall, I finally figured out why my script works with AHK but not AHKCE... It seems InputBox is broken.
Or is there something wrong with my code?
| Code: | InputBox, var1, Title, Prompt
MsgBox You entered %var1%
|
The above code returns nothing when user input is entered. Works fine on (desktop) AHK. |
Hi,
you are right. I've found the bug. Please try the download below.
Is it working for you?
http://www.autohotkey.net/~Micha/AutohotkeyCE/AHKCE_InpBox.exe
Ciao
Micha |
|
| Back to top |
|
 |
Micha
Joined: 15 Nov 2005 Posts: 500 Location: Germany
|
Posted: Tue Mar 24, 2009 9:09 pm Post subject: Re: Why won't this work? Workaround? |
|
|
| Donny Bahama wrote: | I'm trying to set the focus to the GUI Edit control (so I don't have to click in it before I start entering the text. The following code works in AHK (desktop)
| Code: | Gui, Add, Text, w180, Text to search for?
Gui, Add, Edit, +Tabstop r1 w180 vFindTxt
Gui, Add, Button, center gFindNow, OK
Gui, Show, center w200, Find Item(s)
send, {tab}{tab}
return |
I also tried using MouseClick (in place of the Send, {tab} statement) but it was ignored. I'm not sure how to use ControlFocus, but I suspect it won't work because Send and MouseClick don't. The only other means I know of is using GuiControl Focus, but GuiControl isn't supported.
Anybody done this successfully? Any suggestions for setting the focus to the Edit control? |
Hi,
the following script is working
Ciao
Micha
| Code: | _gui()
{
gui, add, edit, w600 ; Add a fairly wide edit control at the top of the window.
gui, add, text, section, First Name: ; Save this control's position and start a new section.
gui, add, text,, Last Name:
gui, add, edit, ys ; Start a new column within this section.
gui, add, edit
gui, show, , AHKGuiTitel
IfWinExist, AHKGuiTitel
MsgBox, AHKGuiTitel existiert
else
MsgBox, AHKGuiTitel existiert nicht
loop, 30
{
ControlFocus, Edit1, AHKGuiTitel
Sleep, 500
ControlFocus, Edit2, AHKGuiTitel
Sleep, 500
}
ControlFocus, Edit1, AHKGuiTitel
ControlSetText, Edit1, Das ist der neue Text, AHKGuiTitel
Sleep, 4000
ControlSend, Edit2, KeysToSend, AHKGuiTitel
MsgBox, fertig
} |
|
|
| Back to top |
|
 |
Donny Bahama
Joined: 30 Dec 2006 Posts: 132 Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
|
Posted: Wed Mar 25, 2009 12:38 am Post subject: Re: InputBox broken? |
|
|
| Micha wrote: | Please try the download below.
Is it working for you? | No. The first time I ran it, it asked if I wanted to create a sample script. I answered yes and it came back with an error. (Unable to create script.) Subsequent times that I ran it, it did nothing. |
|
| Back to top |
|
 |
Donny Bahama
Joined: 30 Dec 2006 Posts: 132 Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
|
Posted: Wed Mar 25, 2009 12:49 am Post subject: Re: Why won't this work? Workaround? |
|
|
| Micha wrote: | | the following script is working | Works great. Thanks, Micha!
While I have your attention I have a couple of questions:
1. The executable that you gave me to test the InputBox... does that mean you're close to releasing the compiler?
2. When I run a script, then go to the Today screen, there's an AHK icon in the tray. Clicking it shows an option for Window Spy. Should that work? (It doesn't for me, but then, there's no au3_spy.exe - or anything similar on my system.) |
|
| Back to top |
|
 |
TLM
Joined: 21 Aug 2006 Posts: 920 Location: The Shell
|
Posted: Wed Mar 25, 2009 2:21 am Post subject: |
|
|
Dam it why do I have to have Palm devices!
This is friggin brilliant.. _________________
 |
|
| Back to top |
|
 |
Donny Bahama
Joined: 30 Dec 2006 Posts: 132 Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
|
Posted: Wed Mar 25, 2009 2:24 am Post subject: Another bug |
|
|
I seem to have found another bug. When you use Gui,Add, Text to display a lengthy bit of text, so you add vScroll, the text box is displayed, and the scrollbar is displayed, but it won't actually let you scroll.
This one is a real pain. The workaround is to break the text into bite-size chunks and display multiple GUIs. |
|
| Back to top |
|
 |
Donny Bahama
Joined: 30 Dec 2006 Posts: 132 Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
|
|
| Back to top |
|
 |
TLM
Joined: 21 Aug 2006 Posts: 920 Location: The Shell
|
Posted: Wed Mar 25, 2009 1:06 pm Post subject: |
|
|
 _________________
 |
|
| Back to top |
|
 |
Micha
Joined: 15 Nov 2005 Posts: 500 Location: Germany
|
Posted: Wed Mar 25, 2009 8:28 pm Post subject: Re: InputBox broken? |
|
|
| Donny Bahama wrote: | | Micha wrote: | Please try the download below.
Is it working for you? | No. The first time I ran it, it asked if I wanted to create a sample script. I answered yes and it came back with an error. (Unable to create script.) Subsequent times that I ran it, it did nothing. |
Hi, works as designed.
Rename it to AutohotkeyCE.exe and create a script AutohotkeyCE.AHK which is run each time when you're starting the exe.
I've added that hint to the first post.
Ciao
Micha |
|
| Back to top |
|
 |
Micha
Joined: 15 Nov 2005 Posts: 500 Location: Germany
|
Posted: Wed Mar 25, 2009 8:32 pm Post subject: Re: Why won't this work? Workaround? |
|
|
| Donny Bahama wrote: | | Micha wrote: | | the following script is working | Works great. Thanks, Micha!
While I have your attention I have a couple of questions:
1. The executable that you gave me to test the InputBox... does that mean you're close to releasing the compiler?
2. When I run a script, then go to the Today screen, there's an AHK icon in the tray. Clicking it shows an option for Window Spy. Should that work? (It doesn't for me, but then, there's no au3_spy.exe - or anything similar on my system.) |
Hi,
the compiler is still not working at all. After opening the 3. file it crashes. No clue why.
I haven't changed the context menu. As far as I know the ahkspy is a windows-exe and there's no source. It will not work on CE-devices.
There are very good scripts in the script section of this forum to get the names of controls. Perhaps they are working for you
Ciao
Micha |
|
| Back to top |
|
 |
Micha
Joined: 15 Nov 2005 Posts: 500 Location: Germany
|
Posted: Wed Mar 25, 2009 8:33 pm Post subject: Re: Another bug |
|
|
| Donny Bahama wrote: | I seem to have found another bug. When you use Gui,Add, Text to display a lengthy bit of text, so you add vScroll, the text box is displayed, and the scrollbar is displayed, but it won't actually let you scroll.
This one is a real pain. The workaround is to break the text into bite-size chunks and display multiple GUIs. |
Please send me a sample script to reproduce this
Ciao
Micha |
|
| Back to top |
|
 |
Donny Bahama
Joined: 30 Dec 2006 Posts: 132 Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
|
Posted: Wed Mar 25, 2009 9:52 pm Post subject: |
|
|
Yes, I have used scripts to get the names of controls. (In fact, that's how I discovered this no-scroll bug.)
Here's a sample script:
| Code: | #SingleInstance force
dbfile=%A_ScriptDir%\food.txt
FileRead, outfile, %dbfile%
Loop, Parse, outfile, `n
{
If ( A_LoopField = "" )
break
dbrec=%A_LoopField%
If listitems=""
{
listitems=%dbrec%
}
else
{
listitems = %listitems%`n%dbrec%
}
continue
}
outfile=; free up memory
gui, font,s9 wNorm, Tahoma
Gui, Add, Text, w200 h100 vScroll, %listitems%
Gui, Add, Button, center, Done
Gui, Show, x0 y24 w240 h160, Text won't scroll
return
GuiCancel:
ButtonDone:
exitapp
|
and here's the text file that it parses (save as food.txt):
| Code: | bell peppers
bread
broccoli
burritos
cauliflower
cheese
cheeseburger
chimichangas
corn chips
eggs
french fries
fried chicken
green beans
gyros
hummus
nachos
pastrami
pizza
potato chips
ravioli
roast beef
salad
salami
sausage
spaghetti
spinach
sweet peas
tomatoes
tostadas
tuna
|
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|