Jump to content

Sendkeys problem


Recommended Posts

i have a problem...

Send("{ALT}")

this code just one click

when i want always click i must this code

While 1

sleep(30)

Send("{ALT}")

WEnd

how can i tell? so....

always finger on Alt

not press one click

always press

so one finger always on ALT

Could i tell ? :D

Link to comment
Share on other sites

HotKeySet("{F2}", "start")

HotKeySet("{F3}", "stop")

HotKeySet("{F6}", "escape")

main()

Func main()

While 1

WEnd

EndFunc;==>main

Func start()

Send("{ALT}" [, 0])

WEnd

EndFunc;==>start

Func stop()

main()

EndFunc;==>stop

Func escape()

??????????

Exit

EndFunc;==>escape

Link to comment
Share on other sites

  • Moderators

cerix,

There must be literally hundreds of snippets like this on the forums - try using search next time. ;-)

HotKeySet("{F2}", "start")
HotKeySet("{F3}", "stop")
HotKeySet("{F6}", "escape")

Global $fRun = False

main()

Func main()
    While 1
        Sleep(10); Important or you can get 100% CPU usage <<<<<<<<<<<<<<
    WEnd
EndFunc  ;==>main

Func start()
    $fRun = True
    While $fRun
        Send("{ALT}"[, 0])
    WEnd
EndFunc  ;==>start

Func stop()
    $fRun = False
EndFunc  ;==>stop

Func escape()
    Exit
EndFunc  ;==>escape

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

cerix,

Read the Help file for Send:

{ALTDOWN} - Holds the ALT key down until {ALTUP} is sent

But be careful because the key can "stick" down. Search the forum for how to cure that (start with the FAQ sticky at the top :-))

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

cerix,

There must be literally hundreds of snippets like this on the forums - try using search next time. ;-)

HotKeySet("{F2}", "start")
HotKeySet("{F3}", "stop")
HotKeySet("{F6}", "escape")

Global $fRun = False

main()

Func main()
    While 1
        Sleep(10); Important or you can get 100% CPU usage <<<<<<<<<<<<<<
    WEnd
EndFunc ;==>main

Func start()
    $fRun = True
    While $fRun
        Send("{ALT}"[, 0])
    WEnd
EndFunc ;==>start

Func stop()
    $fRun = False
EndFunc ;==>stop

Func escape()
    Exit
EndFunc ;==>escape

M23

but this code not working???

problem here Send("{ALT}"[, 0])

Link to comment
Share on other sites

  • Developers

but this code not working???

problem here Send("{ALT}"[, 0])

correct. You are not supposed to copy the syntax from the helpfile and expect it to work.

[,0] means that this is an optional parameter.

Just use Send("{ALT}").

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

HotKeySet("{F2}", "start")

HotKeySet("{F3}", "stop")

HotKeySet("{F6}", "escape")

Global $fRun = False

main()

Func main()

While 1

Sleep(10)

WEnd

EndFunc ;==>main

Func start()

$fRun = True

While $fRun

Send("{ALT}", 0)

WEnd

EndFunc ;==>start

Func stop()

$fRun = False

EndFunc ;==>stop

Func escape()

Exit

EndFunc ;==>escape

This code pressing as ALT ALT ALT ALT ALT .................................

But

i want

JUST onetimes press but Dont pull over ALT buttons

Link to comment
Share on other sites

  • Developers

There is no need to create a new topic for each question about the same script everytime.

Try using {ALTDOWN}

Jos

PS: All 3 threads merged.

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

HotKeySet("{F2}", "start")

HotKeySet("{F3}", "stop")

HotKeySet("{F6}", "escape")

Global $fRun = False

main()

Func main()

While 1

Sleep(10)

WEnd

EndFunc ;==>main

Func start()

$fRun = True

While $fRun

Send("{ALT}", 0)

WEnd

EndFunc ;==>start

Func stop()

$fRun = False

EndFunc ;==>stop

Func escape()

Exit

EndFunc ;==>escape

This code pressing as ALT ALT ALT ALT ALT .................................

But

i want

JUST onetimes press but Dont pull over ALT buttons

You don't need to start a new thread for a subject you already have a thread for, just post in the first thread.

You do need to learn to read the help. If you look in the help for "Send" you will see a table for the send commands and the resulting key press. What you want is in that list!

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

  • Moderators

cerix,

I already gave you that advice (and some more!) in one of your earlier posts. Please read the responses before posting again. ;-)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...