• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

C Gauges Development

DirectSound really isn't that hard, just look at the examples in the SDK. But, XACT is better.

Patrick
 
Hi people, sound related questions has been made and is fully working. thank you!

==============
Solved! :D

I just changed to inp[0].ki.dwFlags |= KEYEVENTF_KEYUP; and now works well!

Bye :)

==============


I got other problem about simulated keypress.

I'm coding a prototype to test in a .exe file and after adapt to .GAU file.

The situation is:

I need to create a simulated 'R CTRL' to activate teamSpeak voice. I think TS uses DirectX/DirectInput so I made this code:

PHP:
#include <windows.h>
#include "stdio.h"
//#include "Defines.h"

#if(_WIN32_WINNT >= 0x0500)
#define KEYEVENTF_UNICODE 0x0004
#define KEYEVENTF_SCANCODE 0x0008
#endif  _WIN32_WINNT >= 0x0500 

//*********************************************************
// Aqui eu tou pressionando o botão.
static void SetInputDX(WORD input_code_set)
{
	INPUT inp[1];
	memset(inp, 0, sizeof(INPUT));
	inp[0].type = INPUT_KEYBOARD;
	inp[0].ki.wScan = input_code_set;
	inp[0].ki.dwExtraInfo = 0;
	SendInput(1, inp, sizeof(INPUT));
}
//*********************************************************
// Aqui eu tou soltando o botão.
static void ReleaseInputDX(WORD input_code_release)
{
	INPUT inp[1];
	memset(inp, 0, sizeof(INPUT));
	inp[0].type = INPUT_KEYBOARD;
	inp[0].ki.dwFlags |= KEYEVENTF_SCANCODE;
	//inp[0].ki.dwFlags |= KEYEVENTF_KEYUP;
	inp[0].ki.wScan = input_code_release;
	inp[0].ki.dwExtraInfo = 0;
	SendInput(1, inp, sizeof(INPUT));
}

void main() {
	SetInputDX(0x45); // 0x45 = numlock key

	ReleaseInputDX(0x45);
}

I don't have TS at this computer and I can't install it because I don't have admin privileges. Because of this, I'm testing simulating numLock (0x45) keypress. Running the code once, you'll see that num lock is going off (if it was on). Running again, the key didn't back on. I really don't know why it's happening.

After running the code, if I fisically press numLock, It seems the key was pressed twice :eek:


It's little confusing... I think running the code you will understand me better.

Can you help me people? I'm about 1 week with this problem without solution... Thank you in advance.
 
Last edited:
Back
Top