Gamepads for OHR

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Huh, that doesn't sound right. What happens if you use the gfx_sdl backend instead of gfx_directx, or vice versa? you can switch between them by adding/removing gfx_directx.dll or via command line arguments.
User avatar
Soda_piggy
Slime Knight
Posts: 163
Joined: Tue Oct 16, 2007 1:18 am
Location: Osaka, Japan
Contact:

Post by Soda_piggy »

Thank you so much! The audiere.dll fixes the problem right up. :D
<a href="https://www.sodapiggymusic.com">Soda Piggy Website</a>
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

VampiDucki wrote:Thank you so much! The audiere.dll fixes the problem right up. :D
That can't possibly be it-- audierre.dll is for the music backed, and I don't see how it could be affecting the keyboard input, which is fully controlled by the gfx backend.

Can you be more specific about what you did to work around the problem?
User avatar
Soda_piggy
Slime Knight
Posts: 163
Joined: Tue Oct 16, 2007 1:18 am
Location: Osaka, Japan
Contact:

Post by Soda_piggy »

Seriously, all I did was remove gfx_directx.dll and add audiere.dll. I thought it was kind of strange too, but it's working for some odd reason...
<a href="https://www.sodapiggymusic.com">Soda Piggy Website</a>
User avatar
Soda_piggy
Slime Knight
Posts: 163
Joined: Tue Oct 16, 2007 1:18 am
Location: Osaka, Japan
Contact:

Post by Soda_piggy »

Correction, it seems to work just fine without either. I removed both from the folder. Just getting rid of gfx_directx.dll made it work fine.
<a href="https://www.sodapiggymusic.com">Soda Piggy Website</a>
User avatar
Bob the Hamster
Liquid Metal King Slime
Posts: 7460
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Ah! yes, that make sense. Removing gfx_directx.dll switched you over from the gfx_directx to the gfx_sdl backend. So that means that the bug you were experiencing was in the gfx_directx backend.
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Hmm, I see that gfx_directx is indeed doing something unusual with the arrow keys. When it receives one of those keypresses, it checks whether the "extended key flag" is set. Buried in the winapi documentation I found:
The Extended Key Flag is 1 if the keystroke results from one of the additional keys on the IBM enhanced keyboard. (The enhanced keyboard has 101 or 102 keys. Function keys are across the top. Cursor movement keys are separate from the numeric keypad, but the numeric keypad also duplicates the cursor movement keys.) This flag is set to 1 for the Alt and Ctrl keys at the right of the keyboard, the cursor movement keys (including Insert and Delete) that are not part of the numeric keypad, the slash (/) and Enter keys on the numeric keypad, and the Num Lock key
Basically, by checking these bits gfx_directx is trying to support early PC keyboards that did not have separate arrows keys

I think this could be considered an obscure bug in Joy2key, where it doesn't set the extended flag, and unsurprisingly almost no application (not the example code in the winapi documentation, nor any code I could find on the internet) bothers to check the extended key bit.

I'll remove that check from gfx_directx, because the way it's written, it would actually break on those old keyboards by treating them as if they didn't have arrow keys.
User avatar
Shizuma
Slime Knight
Posts: 257
Joined: Mon Mar 10, 2008 11:11 am
Location: Toronto, ON

Post by Shizuma »

Anybody with a old keyboard like that is going to have a Model M which did have arrow keys anyway.

I've never seen anybody looking for PC/XT or AT's.
Last edited by Shizuma on Wed Mar 20, 2013 3:02 pm, edited 1 time in total.
Post Reply