Sign in to follow this  
Followers 0
huldu

Send(), is it possible to read?

12 posts in this topic

I was just wondering if its possible to "ask" a user what keys he would like to use, for example ALT-1 and get, the response back in a Send() friendly variable?

For example, a small pop-up appears asking user to select the keys he wishes to use, he presses CTRL-2. The script gets the response as a variable that can be used with Send().

This was probably horribly explained and i hope someone understands. I couldnt find any function for reading keystrokes. Im gonna look a bit more tho.


"I'm paper, rock is fine, nerf scissors!!!"

Share this post


Link to post
Share on other sites



You mean like the control to the bottom left on this picture..?

I know someone made something like this a long time ago, but

we're probably talking about a year or something so it could be

hard to find, especially when you don't know what it's called..

I know this isn't the most useful post, but I hope it helped to

make it clearer to others what exactly you want..

Share this post


Link to post
Share on other sites

A popup appears, you press CTRL-1 for example. Another popup appears after that says you pressed ^1 (which is CTRL-1).

Im just trying to get the variable from where a user presses keys, and the variable is compatible with autoit so it can be used in a Send() function.


"I'm paper, rock is fine, nerf scissors!!!"

Share this post


Link to post
Share on other sites

Read my tut , Maby you got some from that ...


-jaenster

Share this post


Link to post
Share on other sites

would it have to be ctrl +, or could it be anything ?

phil

Share this post


Link to post
Share on other sites

send("^<key>")


-jaenster

Share this post


Link to post
Share on other sites

Read my tut , Maby you got some from that ...

You have nothing in your tutorial about my question. The thing is i dont know how to explain the issue. Its quite easy but hard to explain.

My question was if its possible to actually read input from the user and then CONVERT it to something Send() could understand. For example if you press ALT+1, instead of poping up as "ALT+1" it would show as "!+1" so that Send() can understand.


"I'm paper, rock is fine, nerf scissors!!!"

Share this post


Link to post
Share on other sites

i think that it is not hard to make it ..

btw i know now what you mean ..


-jaenster

Share this post


Link to post
Share on other sites

u should look at the _IsPressed function in the help file, that may help u

~cdkid


AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

Share this post


Link to post
Share on other sites

u should look at the _IsPressed function in the help file, that may help u

~cdkid

I cant find that function in the help file, if possible could you PM me a copy of the function?


"I'm paper, rock is fine, nerf scissors!!!"

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

mmm... i think it may be a beta function, not sure

it's in my Misc.au3

*****edit*****

i PMd u the function, here's what it says in the help file:

Parameters:

$s_hexkey | key to check for

$v_dll | optional: handle to dll or default User32.dll

Remarks

(these are all the Hex Key values)

01 Left mouse button

02 Right mouse button

04 Middle mouse button (three-button mouse)

05 Windows 2000/XP: X1 mouse button

06 Windows 2000/XP: X2 mouse button

08 BACKSPACE key

09 TAB key

0C CLEAR key

0D ENTER key

10 SHIFT key

11 CTRL key

12 ALT key

13 PAUSE key

14 CAPS LOCK key

1B ESC key

20 SPACEBAR

21 PAGE UP key

22 PAGE DOWN key

23 END key

24 HOME key

25 LEFT ARROW key

26 UP ARROW key

27 RIGHT ARROW key

28 DOWN ARROW key

29 SELECT key

2A PRINT key

2B EXECUTE key

2C PRINT SCREEN key

2D INS key

2E DEL key

30 0 key

31 1 key

32 2 key

33 3 key

34 4 key

35 5 key

36 6 key

37 7 key

38 8 key

39 9 key

41 A key

42 B key

43 C key

44 D key

45 E key

46 F key

47 G key

48 H key

49 I key

4A J key

4B K key

4C L key

4D M key

4E N key

4F O key

50 P key

51 Q key

52 R key

53 S key

54 T key

55 U key

56 V key

57 W key

58 X key

59 Y key

5A Z key

5B Left Windows key

5C Right Windows key

60 Numeric keypad 0 key

61 Numeric keypad 1 key

62 Numeric keypad 2 key

63 Numeric keypad 3 key

64 Numeric keypad 4 key

65 Numeric keypad 5 key

66 Numeric keypad 6 key

67 Numeric keypad 7 key

68 Numeric keypad 8 key

69 Numeric keypad 9 key

6A Multiply key

6B Add key

6C Separator key

6D Subtract key

6E Decimal key

6F Divide key

70 F1 key

71 F2 key

72 F3 key

73 F4 key

74 F5 key

75 F6 key

76 F7 key

77 F8 key

78 F9 key

79 F10 key

7A F11 key

7B F12 key

7C-7F F13 key - F16 key

80H-87H F17 key - F24 key

90 NUM LOCK key

91 SCROLL LOCK key

A0 Left SHIFT key

A1 Right SHIFT key

A2 Left CONTROL key

A3 Right CONTROL key

A4 Left MENU key

~cdkid

Edited by cdkid

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

Share this post


Link to post
Share on other sites

maybe this could help

#include <GuiConstants.au3>
#include <Misc.au3>

HotKeySet("{ESC}", "Terminate")
Dim $label, $Tkey, $T
Dim $key = StringSplit("01 Left mouse button,02 Right mouse button,*,04 Middle mouse button (three-button mouse),05 Windows 2000/XP: X1 mouse button,06 Windows 2000/XP: X2 mouse button,*,08 BACKSPACE key,"  & _
"09 TAB key,10 SHIFT key,11 CTRL key,12 ALT key,*,14 CAPS LOCK key,*,*,*,*,*,20 SPACEBAR,21 PAGE UP key,22 PAGE DOWN key,23 END key,24 HOME key,25 LEFT ARROW key,26 UP ARROW key,27 RIGHT ARROW key," & _
"28 DOWN ARROW key,29 SELECT key,30 0 key,31 1 key,32 2 key,33 3 key,34 4 key,35 5 key,36 6 key,37 7 key,38 8 key,39 9 key,*,41 A key,42 B key,43 C key,44 D key,45 E key,46 F key,47 G key,48 H key,49 I key," & _
"50 P key,51 Q key,52 R key,53 S key,54 T key,55 U key,56 V key,57 W key,58 X key,59 Y key,60 Numeric keypad 0 key,61 Numeric keypad 1 key,62 Numeric keypad 2 key,63 Numeric keypad 3 key,64 Numeric keypad 4 key," &  _
"65 Numeric keypad 5 key,66 Numeric keypad 6 key,67 Numeric keypad 7 key,68 Numeric keypad 8 key,69 Numeric keypad 9 key,70 F1 key,71 F2 key,72 F3 key,73 F4 key,74 F5 key,75 F6 key,76 F7 key,77 F8 key,78 F9 key,79 F10 key" , "," )

GUICreate("_IsPressed() Test")

Dim $list = GUICtrlCreateList("", 70, 10, 250, 300)
GUICtrlCreateLabel("Key Testing", 50, 350, 80, 25)
Dim $label = GUICtrlCreateLabel("" ,150, 350, 350, 25)
GUISetState()

While 1
    For $T = 1 to $key[0] -1
        GUICtrlSetData($label, $key[$t] )
        If $Key[$t] = "*" Then ContinueLoop
        $Tkey = $key[$t]
        Test($Tkey, $T)
    Next
    MsgBox(0,"Test", "Complete", 3)
    ExitLoop
WEnd    


Func Test($Tkey, $A)
$dll = DllOpen("user32.dll")
$Times = 500
While 2
    
    $Times = $Times - 1
    If $Times = 0 then
        MsgBox(0,$A & " Timed out",  $Tkey & " Did not Work", 3)
        Return
    EndIf
    
    Sleep (5)
    If _IsPressed($A, $dll) Then
        GUICtrlSetData($list, $Tkey & " Worked|")
        DllClose($dll)
        Return
    EndIf
WEnd

EndFunc

Func Terminate()
    Exit
EndFunc

you will need beta

for a GREAT tutorial see this post

http://www.autoitscript.com/forum/index.php?showtopic=21048#

good luck

8)


NEWHeader1.png

Share this post


Link to post
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
Sign in to follow this  
Followers 0