Re: Could you please help me figure out what i'm doing wrong?
"damien c. sadler" <[email protected]>
| Newsgroups | gmane.comp.windows.autoit.user |
|---|---|
| Message-ID | <[email protected]> |
if you are using jaws you must unload it for the menu. i had that problem
once.
how i would create a menu without doing a key check and using a hotkeyset is
create functions like up, down, select, in the following manner:
global $menu_item=1
hotkeyset("{up}","move_up")
hotkeyset("{down}","move_down")
hotkeyset("{enter}","select_item")
;ok, so let's now assume you have three menu items
func move_up()
if $menu_item=1 then
$menu_item=3
else
$menu_item-=1
endif
play_item($menu_item)
endfunc
func move_down()
if $menu_item=3 then
$menu_item=1
else
$menu_item+=1
endif
play_item($menu_item)
endfunc
func select_item()
if $menu_item=1 then start()
if $menu_item=2 then test()
if $menu_item=3 then quit()
endfunc
func start()
;code goes here ...
endfunc
func test()
;code goes here ...
endfunc
func quit()
exit
endfunc
func play_item($menu_index=1)
if $menu_index=1 then soundplay(@scriptdir & "\sounds\speech\menu\1.wav",1)
if $menu_index=2 then soundplay(@scriptdir & "\sounds\speech\menu\2.wav",1)
if $menu_index=3 then soundplay(@scriptdir & "\sounds\speech\menu\3.wav",1)
endfunc
hth.
regards,
damien c. sadler - x-sight interactive manager
(http://x-sight.brandoncole.net)
----- Original Message -----
From: "Jodie and Tiger" <[email protected]>
To: <[email protected]>
Sent: Thursday, October 12, 2006 4:11 PM
Subject: Re: [AutoIt] Could you please help me figure out what i'm doing
wrong?
> Yeah, it is, but he's so busy it's hard to get a hold of him. Would you
have
> any idea how I can do this? I understand the $catp part of the key handle,
> but it doesn't work with the hot key sets I have in the code for my main
> file and I can't get the $capt to work in that one.
>
> Hugs from Jodie and kisses from Tiger.
> :)
> "Belief is the cradle of myth."
> Stephen King
>
>
> ----- Original Message -----
> From: "damien c. sadler" <[email protected]>
> To: <[email protected]>
> Sent: Thursday, October 12, 2006 2:41 AM
> Subject: Re: [AutoIt] Could you please help me figure out what i'm doing
> wrong?
>
>
> > you can't set a hotkey to a function that contains parameters.
> >
> > out of interest, is that philip bennefall's menu code?
> >
> > regards,
> >
> > damien
> >
> >
> >
> >
> > ----- Original Message -----
> > From: "Jodie and Tiger" <[email protected]>
> > To: <[email protected]>
> > Sent: Wednesday, October 11, 2006 6:08 PM
> > Subject: [AutoIt] Could you please help me figure out what i'm doing
> > wrong?
> >
> >
> >> Hi. I'm trying to make a less complicated library than I have using
> > hotkeyset, but I can't seem to get it to work. From this code, could
> > someone
> > help me figure out what I'm missing? Thanks in advance.
> >>
> >> #include-once
> >> HotKeySet("{up}", "create_audio_menu")
> >> HotKeySet("{down}", "create_audio_menu")
> >> HotKeySet("{enter}", "create_audio_menu")
> >> Func create_audio_menu($description,$options)
> >> If $description = "" Then return 0
> >> If $options = "" Then return 0
> >> $selection = 0
> >> $items = StringSplit($options,",")
> >> If @Error Then return 0
> >> $menu_length = $items[0]
> >> $menu = $device.OpenSound($description & "",true)
> >> $menu.Play()
> >> While 1
> >> $active_window = WinGetProcess("")
> >> If $active_window = @AutoItPid Then
> >> Else
> >> Sleep(10)
> >> ContinueLoop
> >> EndIf
> >> If $selection > 0 Then
> >> $menu = ""
> >> return $selection
> >> EndIf
> >> If $selection < 1 Then
> >> $selection = $menu_length
> >> EndIf
> >> $file_to_open = $items[$selection]
> >> $menu = $device.OpenSound($file_to_open & "",true)
> >> $menu.Play()
> >> $limit = $menu_length+1
> >> If $selection = $limit Then
> >> $selection = 1
> >> EndIf
> >> $file_to_open = $items[$selection]
> >> $menu = $device.OpenSound($file_to_open & "",true)
> >> $menu.Play()
> >> WEnd
> >> EndFunc
> >>
> >> Hugs from Jodie and kisses from Tiger.
> >> :)
> >> "Belief is the cradle of myth."
> >> Stephen King
> >>
> >>
> >> ----------------------------------------
> >> I am using the free version of SPAMfighter for private users.
> >> It has removed 2521 spam emails to date.
> >> Paying users do not have this message in their emails.
> >> Get the free SPAMfighter here: http://www.spamfighter.com/len
> >>
> >> [Non-text portions of this message have been removed]
> >>
> >>
> >>
> >>
> >> Yahoo! Groups Links
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> > --
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.1.408 / Virus Database: 268.13.2/472 - Release Date:
10/11/2006
> >
>
> ----------------------------------------
> I am using the free version of SPAMfighter for private users.
> It has removed 2516 spam emails to date.
> Paying users do not have this message in their emails.
> Get the free SPAMfighter here: http://www.spamfighter.com/len
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AutoItList/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/AutoItList/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[email protected]
mailto:[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/