Jump to content

send keys to OS not active window


Recommended Posts

Hiya,

I have a cheapo belkin KVM switch (lets me share use one keyboard, mouse and monitor between 2 comps)

The way it switches computers is by use of a keypress combination

{SCROLLLOCK}{SCROLLLOCK}1

or

{SCROLLLOCK}{SCROLLLOCK}2

where 1 and 2 represent the ID of the computers connected to the other end.

My simple question is, Is is possible for autoit to send this combination so that it is trapped by the switch? At the moment whenever I send this combination using

Send("{SCROLLLOCK toggle}{SCROLLLOCK toggle}1")

The active window is populated with 1 or 2

thanks in advance, and sorry if its a dumb question!

Edited by autoit3fan
Link to comment
Share on other sites

  • Moderators

You could try:

ControlSend('Program Manager', '', '', '{SCROLLLOCK toggle}{SCROLLLOCK toggle}1')
(I have no idea if this would work).

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Hiya,

I have a cheapo belkin KVM switch (lets me share use one keyboard, mouse and monitor between 2 comps)

The way it switches computers is by use of a keypress combination

{SCROLLLOCK}{SCROLLLOCK}1

or

{SCROLLLOCK}{SCROLLLOCK}2

where 1 and 2 represent the ID of the computers connected to the other end.

My simple question is, Is is possible for autoit to send this combination so that it is trapped by the switch? At the moment whenever I send this combination using

Send("{SCROLLLOCK toggle}{SCROLLLOCK toggle}1")

The active window is populated with 1 or 2

thanks in advance, and sorry if its a dumb question!

I would be very surprised if that was possible. When AutoIT sends a keystroke, it writes to a software keyboard buffer using API's from OS, etc., without actually interfacing to the real keyboard at all. Most KVM switches have the keyboard physically plugged into them and get to catch hotkey actions like "{SCROLLLOCK}{SCROLLLOCK}2" on the wire before it even gets to the PS2 or USB port on the computer. The OS never sees these hotkey sequences becuase they are picked off the wire before it gets there.

:whistle:

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
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...