Sign in to follow this  
Followers 0
gehonglin

Bug for RunAsSet

16 posts in this topic

I found a keyboard bug when using the following script:

RunAsSet("aaaa", @computername, "123")

RunWait("NotePad.exe")

The NotePad is opened by AutoIt in this way, the key to change input languages (keyboard layout) is ALT+SHIFT;

But when the NotePad is opened by me directly, the key is CTRL+SHIFT.

Does anyone know how to solve this problem? thanks.

Share this post


Link to post
Share on other sites



I see the settings under:

Control Panel > Regional and Language Options > Languages > Details > Key Settings > Change Key Sequence

This should be a global setting and not effected by RunAsSet()

Share this post


Link to post
Share on other sites

Logged in as that person... check that setting.

Lar.


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Share this post


Link to post
Share on other sites

hi weaponx,

I set the hotkeys under:

Control Panel > Regional and Language Options > Languages > Details > Key Settings > Change Key Sequence

but I found it strange, when using RunAsSet("aaaa",@ComputerName,"123"), the hotkeys is contrary to above setting.

if the system setting is CTRL+SHIFT, the result using RunAsSet will be ALT+SHIFT.

if the system setting is ALT+SHIFT, the result using RunAsSet will be CTRL+SHIFT.

Do you have any idea about this?

Share this post


Link to post
Share on other sites

Perhaps Windows recognizes that the hotkey is already assigned and dynamically uses a different assignment.

Lar.


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Share this post


Link to post
Share on other sites

dear LarryDalooZa,

if I just use the following script:

RunWait("NotePad.exe")

then the hotkey is the same as system setting.

but if i use:

RunAsSet("aaaa", @computername, "123")

RunWait("NotePad.exe")

the hotkey is always contrary to system settings.

Do you have any idea to help to resolve this problem? thank you.

Share this post


Link to post
Share on other sites

I found it strange.

It seems only hotkeys - CTRL+SHIFT, CTRL+ALT are contrary to system setting when using RunAsSet, other hotkeys are normal.

Is it possibly a bug in AutoIt?

Share this post


Link to post
Share on other sites

Did you check these settings whiule logged in under user "aaaa"??

Share this post


Link to post
Share on other sites

Yes, the setting is the same with other accounts.

Share this post


Link to post
Share on other sites

You have 2 users logged in ... yourself and the runnasset person ...

Each user is trying to set the Global hotkey ... they both can't set the same key ...

it is going to be some derivative of the above...

try Running...

RunAsSet("aaaa", @computername, "123")

RunWait("control intl.cpl")

and look at the languages\details\key sequence ... stuff ...

It should never be the same as the control intl.cpl that is run as yourself...

Anyway, I can see your problem in my head, but I cannot relay it well...

Good luck.

Lar.


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Share this post


Link to post
Share on other sites

You have 2 users logged in ... yourself and the runnasset person ...

Each user is trying to set the Global hotkey ... they both can't set the same key ...

it is going to be some derivative of the above...

try Running...

RunAsSet("aaaa", @computername, "123")

RunWait("control intl.cpl")

and look at the languages\details\key sequence ... stuff ...

It should never be the same as the control intl.cpl that is run as yourself...

Anyway, I can see your problem in my head, but I cannot relay it well...

Good luck.

Lar.

thanks LarryDalooZa, I tried your code, and the system settings for the input language is as same as what i opened by myself.

My problem still exists.....

When using:

RunAsSet("aaaa", @computername, "123")

RunWait("NotePad.exe")

it seems that one of the two hotkeys(CTRL+SHIFT and CTRL+ALT) will be disabled, meanwhile, the enabled hotkey will be contrary to the system settings.

Anybody has any good idea for resolving this problem? thanks.

Share this post


Link to post
Share on other sites

try using the "option" parameter of RunAsSet ... do NOT load the profile ... try maybe option 0

Lar.


f_mrcleansmalm_77ce002.jpgAutoIt has helped make me wealthy

Share this post


Link to post
Share on other sites

i have tried option 0, 1, 2 in RunAsSet. But the hotkey is still ALT + SHIFT, contrary to the system settings.

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

What happens if you manually use the "Run As" function of your Operating System (OS)?

What OS are you having this problem with?

Edit: I could not duplicate your problem using XP Pro SP3 RC2 (5508).

The OS "Run As"...

AutoIt's RunAsSet...

Manually opening notepad...

...all three gave the same results.

I tried:

RunAsSet("aaaa", @computername, "123")
RunWait("notepad")oÝ÷ Ù©Ýjëh×6RunAsSet("aaaa", @computername, "123")
Run("notepad")
Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Thanks herewasplato. My Operating System is XP Pro SP2 ( 5.1.2600 Service Pack 2 Build 2600).

I tried three methods as you done:

The OS "Run As"...

AutoIt's RunAsSet...

Manually opening notepad...

The first and second methods give the same results, but are different from the third.

Share this post


Link to post
Share on other sites

Then AutoIt is doing what it is supposed to - simulating your OS conditions.

I see nothing on MS TechNet about this - but it was only a quick search.

Maybe others here have a clue how your OS is doing this.

Do you have other computers that you can test this on?


[size="1"][font="Arial"].[u].[/u][/font][/size]

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