Sign in to follow this  
Followers 0
ohgod

ALT+ASCII CHAR

22 posts in this topic

#1 ·  Posted (edited)

EDIT: To make it clear this is about pressing ALT and "é" (an ANSI charater used in my language) to reach a menu function (like File menu in English)

With the usual codes it cannot be accomplished

Send("!{ASC 0233}")
Send("{ALTDOWN}{ASC 233}{ALTUP}")
Send("{ALTDOWN}é{ALTUP}")

These gives me an "é" character but not the function I want.

On the same spot where the script fails by manually pushing down the buttons the function starts working.

Is there a solution for this?

EDIT end

First of all, sorry for this noobish question but I can't work it out.

I have to press ALT and the character "é" (ALT+130) simultanously.

Tried a couple of solutions but non of them worked.

Can somebody help me?

Edited by ohgod

Share this post


Link to post
Share on other sites



Send(Chr(130)) Should work.

Share this post


Link to post
Share on other sites

and the alt must be pressed meanwhile.

like

send("!é")

an other problem is : chr(130) does not give the same character as ALT - 130

Send(Chr(130)) Should work.

Share this post


Link to post
Share on other sites

and the alt must be pressed meanwhile.

like

send("!é")

an other problem is : chr(130) does not give the same character as ALT - 130

I think you are confusing keyboard scan codes, which represent buttons pushed, with character codes that represent language-specific characters. Is there a é button on your keyboard?

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

yes there is!

and it is Chr(233)

now i just have to SEND it somehow but cant find the syntax

SEND("!"chr(233))

I need to activate a menu with the ALT+é combination.

Share this post


Link to post
Share on other sites

$x=Chr(233)
Send("!"$x)

this is the best i came across, but it doesnt do a thing.

Can anyone tell me the how to use this properly?

Share this post


Link to post
Share on other sites

yes there is!

and it is Chr(233)

now i just have to SEND it somehow but cant find the syntax

SEND("!"chr(233))

I need to activate a menu with the ALT+é combination.

The confusion continues... :)

Can you type é from your keyboard with one (and only one) key stroke? I suspect not. Chr(233) is character encoding, not a keyboard button (unless you have a non-english keyboard and language configured in windows).

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Yes I have a foreign keyboard with "é" button on it.

The to reach a menu in the non-english application I have to press ALT-é, similar when you have to press ALT-f to reach the file menu.

Just tell me please how to press the ALT button, and "é" button simultanously.

with autoit of course

The confusion continues... :)

Can you type é from your keyboard with one (and only one) key stroke? I suspect not. Chr(233) is character encoding, not a keyboard button (unless you have a non-english keyboard and language configured in windows).

:)

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Yes I have a foreign keyboard with "é" button on it.

The to reach a menu in the non-english application I have to press ALT-é, similar when you have to press ALT-f to reach the file menu.

Just tell me please how to press the ALT button, and "é" button simultanously.

with autoit of course

Is the "é" button in the same physical location as "e" on a standard US keyboard? If so, Send("!e") may work, by sending the appropriate keyboard scan code. If not, try that with whatever english character would normally occupy that keyboard button position.

Sorry. I don't have a keyboard like yours to test with.

:)

Edit: Left quotes off Send() string

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Yes I have a foreign keyboard with "é" button on it.

The to reach a menu in the non-english application I have to press ALT-é, similar when you have to press ALT-f to reach the file menu.

Just tell me please how to press the ALT button, and "é" button simultanously.

with autoit of course

Send("{ALTDOWN}é{ALTUP}")

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites

Send("{ALTDOWN}é{ALTUP}")

Send("{ALTDOWN}é{ALTUP}")

it writes an "é" character, but does not activates the menu.

with phisically pressing ALT+é at the same spot, the menu comes up it.

i'm dieing here.....

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

Send("{ALTDOWN}é{ALTUP}")

it writes an "é" character, but does not activates the menu.

with phisically pressing ALT+é at the same spot, the menu comes up it.

i'm dieing here.....

Did you try my suggestion in post #9? (As modified - I had forgot the quotes around "!e")

:)

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Send("{ALTDOWN}é{ALTUP}")

it writes an "é" character, but does not activates the menu.

with phisically pressing ALT+é at the same spot, the menu comes up it.

i'm dieing here.....

try

Send("{ALTDOWN}{ASC 0233}{ALTUP}")

or

Send("{ALTDOWN}{ASC 130}{ALTUP}")

Edited by Bowmore

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Did you try my suggestion in post #9?

:)

The actual layout of the keyboard does not depend on the physical layout of the buttons, it depends on the character table that is assigned to it.

When the hungarian language is set in windows, the character "é" is assigned to the ";" button.

If I send ";", I send the character ";" that has nothing to do with the actual buttons on my keyboard.

So I guess it's not possible to use the send command with ALT+ASCII character

Send("!{ASC 0233}")

or

Send("{ALTDOWN}{ASC 0233}{ALTUP}")

both of them just write a "é" character.

Edited by ohgod

Share this post


Link to post
Share on other sites

The actual layout of the keyboard does not depend on the physical layout of the buttons, it depends on the character table that is assigned to it.

When the hungarian language is set in windows, the character "é" is assigned to the ";" button.

If I send ";", I send the character ";" that has nothing to do with the actual buttons on my keyboard.

So I guess it's not possible to use the send command with ALT+ASCII character

Send("!{ASC 0233}")

or

Send("{ALTDOWN}{ASC 0233}{ALTUP}")

both of them just write a "é" character.

Hmm... I'm more after Virtual-Key Codes:

VK_OEM_1 (0xBA)

Used for miscellaneous characters; it can vary by keyboard.

Windows 2000/XP: For the US standard keyboard, the ';:' key

This same virtual key code would appear to be mapped to "é" for the Hungarian keyboard layout. Correct?

That means this same code would respond to your ";" on a US keyboard, or "é" on a Hungarian:

#Include <Misc.au3>

HotKeySet("{ESC}", "_Quit")
$vDLL = DllOpen('user32.dll')

While 1
    If _IsPressed("BA", $vDLL) Then ConsoleWrite("Debug: VirtualKey 0xBA pressed" & @LF)
    Sleep(10)
WEnd

Func _Quit()
    Exit
EndFunc

The UDF _IsPressed() uses a call to user32.dll "GetAsyncKeyState" to check the state of that virtual-key. I don't know enough .dll usage to figure out if you can "SetKeyState" with the same Virtual-key code.

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Hmm... I'm more after Virtual-Key Codes:

This same virtual key code would appear to be mapped to "é" for the Hungarian keyboard layout. Correct?

That means this same code would respond to your ";" on a US keyboard, or "é" on a Hungarian:

#Include <Misc.au3>

HotKeySet("{ESC}", "_Quit")
$vDLL = DllOpen('user32.dll')

While 1
    If _IsPressed("BA", $vDLL) Then ConsoleWrite("Debug: VirtualKey 0xBA pressed" & @LF)
    Sleep(10)
WEnd

Func _Quit()
    Exit
EndFunc

The UDF _IsPressed() uses a call to user32.dll "GetAsyncKeyState" to check the state of that virtual-key. I don't know enough .dll usage to figure out if you can "SetKeyState" with the same Virtual-key code.

:)

uhm i don't think i could figure that out

the other thing is that the keyboard itself is standard english(ok I admit I've lied), the windows char set is set with a secondary hungarian language but i seldomly use it. so it's always on ENglish.

The application is the Excel (a hungarian one), and the Autoit should send a document/diagram through it(by email).

Everything is ok and set, only the last step is missing, I can't push the "send message" button because it's name is (lap küldése) where the "é" is UNDERLINED.

I tried to reach it with controlclick but cant grab it.

the only working solution so far was mouseclick :party:

:)

Share this post


Link to post
Share on other sites

This is the thing I want to click so badly

anyone?

please? :)

>>>> Window <<<<

Title: Microsoft Excel - probaimport

Class: XLMAIN

Position: -4, -4

Size: 1032, 746

Style: 0x15CF0000

ExStyle: 0x00000110

Handle: 0x00320546

>>>> Control <<<<

Class: ToolbarWindow32

Instance: 1

ClassnameNN: ToolbarWindow321

ID:

Text:

Position: 9, 52

Size: 1009, 26

ControlClick Coords: 66, 14

Style: 0x52009949

ExStyle: 0x00000080

Handle: 0x00150722

>>>> Mouse <<<<

Position: 75, 85

Cursor ID: 2

Color: 0xD4D0C8

>>>> StatusBar <<<<

>>>> Visible Text <<<<

Boríték

lo

probaimport

Formázás

17.5

Arial

Szokásos

Diagramkészítés menüsora

Kérdése van? Írja be ide.

[probaimport.xls]Munka1 Diagram 2

probaimport

>>>> Hidden Text <<<<

seymoor@gmail.com (googlemail)

Share this post


Link to post
Share on other sites

Can't you open the menu with only pressing alt, then pressing the down arrow on your keyboard until the item you want is selected, and then pressing enter?

Or perhaps, use the "GuiMenu Management" UDF's to do it? - workarounds...

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

uhm i don't think i could figure that out

the other thing is that the keyboard itself is standard english(ok I admit I've lied), the windows char set is set with a secondary hungarian language but i seldomly use it. so it's always on ENglish.

The application is the Excel (a hungarian one), and the Autoit should send a document/diagram through it(by email).

Everything is ok and set, only the last step is missing, I can't push the "send message" button because it's name is (lap küldése) where the "é" is UNDERLINED.

I tried to reach it with controlclick but cant grab it.

the only working solution so far was mouseclick :party:

:)

The truth will out... :)

You can probably just use the _GuiCtrlToolbar_* UDFs to get the item directly. Check out the example I posted in another topic. The issue there was the System Tray, but that's just another toolbar in another window, and you should be able to adapt it.

:lmao:

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Allright so I managed to PRESS the button with this simple test script but it does NOT FIRE IT UP. It's looks like pressed, that is all.

#Include <GuiToolBar.au3>
Opt("WinTitleMatchMode", 4)
Global $hTray = WinGetHandle("[CLASS:XLMAIN]")
Global $hToolbar = ControlGetHandle($hTray, "", "[CLASSNN:ToolbarWindow321]")
Global $idSave= ("40224")
$n=1
$iCmd = _GUICtrlToolbar_IndexToCommand($hToolbar, $n)
_GUICtrlToolbar_pressButton($hToolbar, $idSave)

The help mentions a _GUICtrlToolbar_CLICKButton that would fire it up but this function does not exist.

This is starting to get more and more complicated.

Any other way?

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