PDA

View Full Version : Sending keypresses


andrea19
30-08-2008, 22:23
Hi,

I'm trying to make a 3rd party program that mutes the TS output when another player in the channel is speaking, so that when both of us are in the same room we don't get echo while speaking.

As there is no mute option to mute another player (and the pfOutputMuted flag usually leads to an excess flood kick), and there isn't also any way to control volume within the SDK, i tried setting up a key combination for letting the volume down to 0%, and another one to restore it to normal 100% level.

My problem here is that using SendInput doesn't seem to work with KeyPress.dll, so I would like to know if you know some other way of sending a key press to TS, or any other way of changing TS volume settings.

Thanks,

Andrea

Thomas
03-09-2008, 04:57
Would be helpful if you mention, which scripting or programming language you use to realize a script/tool of this type.

If you don't want to code it on your own, try Ultrakeyboard (http://www.fadsoft.net/UltraKeyboard.htm).
That's what you need.

andrea19
07-09-2008, 18:26
Hi, thanks for the help, but what I'm trying is to write is an application in C/C++ that sets teamspeak (and only teamspeak, no system volume) to 0 volume when X talks on the channel.

As I explained in the other post, I want this because we're going to use teamspeak on two computers seated one next to the other, and we don't want to hear ourselves when the other one is keying his mic.

As the current SDK doesn't allow setting mute automatically (and we can't do it manually because we're going to be switching channels automatically from another 3rd party app) to a player from a 3rd party program, I thought that the best way would be to mute TS output volume when the other one talks, and then restore it. Firstly I thought on setting the pfOutputMuted flag but this is useless for this purpose because when I set the flag I will no longer know who is speaking on the channel and I wont know when to unset it.

I thought that my only way was to set up a hotkey that sets TS volume to 0 and another one that restores it. I did that and tried to send thoose keys using SendInput from windows API but that doens't work as the KeyPress.dll seems to be using lower level calls to detect key presses.

So what I'm looking for is some way of "cheating" TS to detect thoose key presses, or some other idea to be able to mute the other guy automaticaly when we join the channel.

Thx

Thomas
08-09-2008, 15:21
Some months ago I had a similar problem. My problem was to trigger the voice activation key.

I closed this part of my project, because I've found no solution for it.


Another way instead of triggering a global hotkey would be, to send the keys to the TeamSpeak 2 client, so that the config menu appears (like Ultrakeyboard could do).

But you can code it yourself, too. Give the focus to the client and then send the keys with keybd_event (http://msdn.microsoft.com/en-us/library/ms646304(VS.85).aspx) to the client.

With another Win API function you can move the slider of the output volume.

wazup
12-09-2008, 15:07
Buy the Logitech G11 Keyboard, than you can press 54 Keys to do any things!

(Sorry for my bad english :-D)