AutoHotkey Community

It is currently May 26th, 2012, 4:23 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 453 posts ]  Go to page Previous  1 ... 8, 9, 10, 11, 12, 13, 14 ... 31  Next
Author Message
 Post subject:
PostPosted: January 28th, 2009, 6:36 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
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
   }
}

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject: InputBox broken?
PostPosted: March 23rd, 2009, 6:01 pm 
Offline

Joined: December 30th, 2006, 4:13 pm
Posts: 132
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
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.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 23rd, 2009, 8:42 pm 
Offline

Joined: December 30th, 2006, 4:13 pm
Posts: 132
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: InputBox broken?
PostPosted: March 24th, 2009, 9:01 pm 
Offline

Joined: November 15th, 2005, 11:15 am
Posts: 537
Location: Germany
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


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 24th, 2009, 9:09 pm 
Offline

Joined: November 15th, 2005, 11:15 am
Posts: 537
Location: Germany
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
 
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: InputBox broken?
PostPosted: March 25th, 2009, 12:38 am 
Offline

Joined: December 30th, 2006, 4:13 pm
Posts: 132
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
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.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 25th, 2009, 12:49 am 
Offline

Joined: December 30th, 2006, 4:13 pm
Posts: 132
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
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.)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 25th, 2009, 2:21 am 
Offline

Joined: August 21st, 2006, 7:07 pm
Posts: 2925
Location: The Shell
Dam it why do I have to have Palm devices!

This is friggin brilliant..

_________________
Imageparadigm.shift:=(•_•)┌П┐RTFM||^.*∞


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Another bug
PostPosted: March 25th, 2009, 2:24 am 
Offline

Joined: December 30th, 2006, 4:13 pm
Posts: 132
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 25th, 2009, 2:26 am 
Offline

Joined: December 30th, 2006, 4:13 pm
Posts: 132
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
TLM wrote:
Dam it why do I have to have Palm devices!

This is friggin brilliant..
Buy a Windows Mobile device. Check out all the other goodies you're missing out on... http://forum.xda-developers.com/forumdisplay.php?f=260


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 25th, 2009, 1:06 pm 
Offline

Joined: August 21st, 2006, 7:07 pm
Posts: 2925
Location: The Shell
:shock:

_________________
Imageparadigm.shift:=(•_•)┌П┐RTFM||^.*∞


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: InputBox broken?
PostPosted: March 25th, 2009, 8:28 pm 
Offline

Joined: November 15th, 2005, 11:15 am
Posts: 537
Location: Germany
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


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 25th, 2009, 8:32 pm 
Offline

Joined: November 15th, 2005, 11:15 am
Posts: 537
Location: Germany
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: Another bug
PostPosted: March 25th, 2009, 8:33 pm 
Offline

Joined: November 15th, 2005, 11:15 am
Posts: 537
Location: Germany
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 25th, 2009, 9:52 pm 
Offline

Joined: December 30th, 2006, 4:13 pm
Posts: 132
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
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


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 453 posts ]  Go to page Previous  1 ... 8, 9, 10, 11, 12, 13, 14 ... 31  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: G. Sperotto and 16 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