Jump to content

Keyboard and DirectInput


Recommended Posts

Hello Pete,

I'm asking myself if it's better you add the DirectInput system in FSUIPC to assign each control.

What do you think about DirectInput ?

Because, in FSX, it's not coded well, I surprised Microsoft/Aces didn't use system DirectInput.....

For example the key "INSERT" is like key "Num_0" in FSX..... But these keys are different in keyboard, also in DirectInput too.

So, sometimes, I want to assign INSERT to one control, and to assign Num_0 to other control.

Regards,

Chris.

Link to comment
Share on other sites

I'm asking myself if it's better you add the DirectInput system in FSUIPC to assign each control.

What do you think about DirectInput ?

Not much. I've implemented it for Axis assignment in FSUIPC4, but it only gives 2 more axes and 3 more POVs. Otherwise it is just much heavier (less efficient) code than the direct joystick interface Windows still supports.

Because, in FSX, it's not coded well, I surprised Microsoft/Aces didn't use system DirectInput.....

They do. It is used for all joystick handling and has been since FS2002.

For example the key "INSERT" is like key "Num_0" in FSX..... But these keys are different in keyboard, also in DirectInput too.

Ah, you mean for Keyboard?

I don't see any advantage in using DirectInput for keyboard when the Windows WM_KEYDOWN and WM_KEYUP message system provides everything that is needed.

So, sometimes, I want to assign INSERT to one control, and to assign Num_0 to other control.

Yes, and can you not? Whether Num_0 exists on a keyboard depends on the NUM LOCK key. Maybe you have that off?

Regards

Pete

Link to comment
Share on other sites

Yes, I talk DirectInput for the Keyboard, sorry :)

Yes, and can you not? Whether Num_0 exists on a keyboard depends on the NUM LOCK key. Maybe you have that off?

The problems is to define key for each control with SHIFT for example not only NUM LOCK ON or OFF.

For example, for the control TOGGLE_PAUSE :

-----------------------------------------------------

- If I define the key "INSERT" (not numpad, near key "ENTER") from keyboard in FSX, FSX define "Num_0".

- If I define the key "0" (numpad numlock OFF) from keyboard in FSX, FSX put "Num_0".

- If I define the key "0" (numpad numlock ON) from keyboard in FSX, FSX put "SHIFT+Num_0".

- If I want to define "SHIFT"+"INSERT" from keyboard.

There is CONFUSION because for FSX, it's "SHIFT+Num_0".

Do you understand me?

So, If we use DirectInput with constants, we can define each control easily and powerful, for example :

- DIK_LSHIFT and DIK_NUMPAD0

- DIK_LSHIFT and DIK_INSERT

It's different and no confusion unlike the FSX system.

That's why I think DirectInput is better for gestion of keyboard in FSUIPC.

Regards,

Chris. :)

Link to comment
Share on other sites

Do you understand me?

Can you point to your problem, please?

So, If we use DirectInput with constants, we can define each control easily and powerful, for example :

- DIK_LSHIFT and DIK_NUMPAD0

- DIK_LSHIFT and DIK_INSERT

It's different and no confusion unlike the FSX system.

That's why I think DirectInput is better for gestion of keyboard in FSUIPC.

Have you checked the key code list used at present in FSUIPC? It is in the Advanced User's guide. This certainly differentiates between Numpad0 (Numlock ON) and Insert, for instance.

But the keycode for Numpad and Insert is the same when Num Lock is off. As far as I am aware this is a function of the keyboard driver at BIOS level.

I think I can differentiate between left and right shifts and left and right CTRLs, possibly, but really the question has never arisen. There are so many combinations now available, with Ctrl, Shift, Tab, Window and Menu keys also being usable in combinations, that you can never run short.

Furthermore, by intercepting and using the WM_KEY messages I can take over the key usage, whereas using other methods, when FS is using windows, will not be so easy or reliable.

Maybe it would help if you explained the problem you are attempting to resolve? Perhaps there are better solutions?

Regards

Pete

Link to comment
Share on other sites

Well, your FSUIPC has difference between Insert and Num_0, okay it works well (unlike FSX). Thanks FSUIPC !! :D

But I propose my suggestion for your fsuipc,

it could better if you use the DirectInput offers a large possibility to use "real" or "material" keys of keyboard like :

- DIK_LSHIFT, DIK_RSHIFT, DIK_INSERT, DIK_NUMPAD0, and more.

It's just a suggestion :)

Regards,

Chris.

Link to comment
Share on other sites

it could better if you use the DirectInput offers a large possibility to use "real" or "material" keys of keyboard like :

- DIK_LSHIFT, DIK_RSHIFT, DIK_INSERT, DIK_NUMPAD0, and more.

Well, thanks, but I cannot see how this differs from the information in the Windows keyboard "WM_KEY" messages which I currently process. And if I obtain key presses by other means than intercepting the Windows messages, FS will get the keys too unless I duplicate coding.

I really don't see the advantage. Have you looked into the standard Windows keyboard facilities at all, to see why you think they are deficient?

As I said in my last message, I think I can differentiate between left and right keys where applicable, but the question (need) has not arisen so far.

Regards

Pete

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

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.