QL & PC Joysticks

A place to discuss general QL issues.
stevepoole
Trump Card
Posts: 181
Joined: Mon Nov 24, 2014 2:03 pm

QL & PC Joysticks

Postby stevepoole » Fri Aug 17, 2018 6:03 am

Hi,
I have a working QL Joystick, with a 9 pin D socket, and 6 pin adapter.
It translates 4 arrow keys, with fire and base buttons.

I have written a shootem up game in full 3D perspective animation on QPC2.
Is there any way to adapt the joystick for a laptop?
i.e: it would need an adapter for USB no doubt, if such a thing exists.

Commercial PC 'Joysticks' do not seem to be compatible with QPC2...
Regards,
Steve Poole.


User avatar
vanpeebles
Commissario Pebbli
Posts: 1990
Joined: Sat Nov 20, 2010 7:13 pm
Location: North East UK

Re: QL & PC Joysticks

Postby vanpeebles » Fri Aug 17, 2018 9:14 am

I reckon there must be a way of mapping the PC joystick to the keys on the game?


User avatar
tofro
QL Wafer Drive
Posts: 1447
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: QL & PC Joysticks

Postby tofro » Fri Aug 17, 2018 9:50 am

vanpeebles wrote:I reckon there must be a way of mapping the PC joystick to the keys on the game?


There is -this one is just an example of many possibilities that might be worth trying.


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
vanpeebles
Commissario Pebbli
Posts: 1990
Joined: Sat Nov 20, 2010 7:13 pm
Location: North East UK

Re: QL & PC Joysticks

Postby vanpeebles » Fri Aug 17, 2018 1:04 pm

Any screenshots of the game? Sounds interesting! :ugeek:


User avatar
Peter
Super Gold Card
Posts: 725
Joined: Sat Jan 22, 2011 8:47 am

Re: QL & PC Joysticks

Postby Peter » Fri Aug 17, 2018 1:13 pm

Sounds cool, any chance it will run on native hardware?


stevepoole
Trump Card
Posts: 181
Joined: Mon Nov 24, 2014 2:03 pm

Re: QL & PC Joysticks

Postby stevepoole » Fri Aug 17, 2018 9:20 pm

Thanks for the replies,

I was hoping not to buy a PC joystick, as I have been quoted some pretty onerous prices for them.
Tofro's mapping method may be an option though, if I have no choice with my QL joystick.

I take it a screen-shot would be loaded onto the Forum via the 'Img' button above. I have not used this feature before.

As for native hardware, the program is fast enough on QPC2, but too slow on my SGC QL...

BTW, I can find no way to clear out the keyboard Queue completely. No doubt this is done to avoid people writing keyloggers?

Regards,
Steve Poole.


stevepoole
Trump Card
Posts: 181
Joined: Mon Nov 24, 2014 2:03 pm

Re: QL & PC Joysticks

Postby stevepoole » Fri Aug 17, 2018 9:41 pm

Capture d’écran (59).png


Hi,
This is my first attempt to load a screenshot...

The program draws a 'hilly' draughtsboard. You fly around the scenery shooting at the draughts, against the clock.

(Just a rapid programming exercise, to test some general subroutine updates).

Two players can even play a game of draughts on it, but not against the QL.

Regards,
Steve Poole.


RWAP
RWAP Master
Posts: 2544
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: QL & PC Joysticks

Postby RWAP » Fri Aug 17, 2018 10:13 pm

Looks intriguing :)


stevepoole
Trump Card
Posts: 181
Joined: Mon Nov 24, 2014 2:03 pm

Re: QL & PC Joysticks

Postby stevepoole » Sat Aug 25, 2018 8:28 pm

Hi,
The game could be accelerated considerably, if the keyboard queue could be cleared at will.
Unfortunately, both inkey$ and Keyrow constructs do not clear it, even though documentation states the opposite for the latter.
This means you have to 'peck' rapidly at keys, rather than, say, pressing an arrowkey continuously.
Machine code games seem to avoid this problem, but this game is written in SBasic... Perhaps m/c Pokes some obscure address to clear it out ?
Any suggestions ?
Steve Poole.


User avatar
pjw
Gold Card
Posts: 432
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway

Re: QL & PC Joysticks

Postby pjw » Sat Aug 25, 2018 10:38 pm

stevepoole wrote:Hi,
The game could be accelerated considerably, if the keyboard queue could be cleared at will.
Unfortunately, both inkey$ and Keyrow constructs do not clear it, even though documentation states the opposite for the latter.
This means you have to 'peck' rapidly at keys, rather than, say, pressing an arrowkey continuously.
Machine code games seem to avoid this problem, but this game is written in SBasic... Perhaps m/c Pokes some obscure address to clear it out ?
Any suggestions ?
Steve Poole.

I had this problem years ago and wrote a small toolkit to solve it. Then I discovered that a dummy keyrow call before the inkey$ does the same. Are you saying this doesnt work for you?

Code: Select all

k = KEYROW(0)
k$ = INKEY$(#ch; timeout)

Another thing you might try is

Code: Select all

rep lp: if inkey$(#ch; 0) = "": exit lp:endif:endrep lp

If thats no good, I could send you my ClearQ toolkit to try.


Per
Be wary of large West-Coast corporations bearing gifts!
- Ancient Trojan proverb

Return to “General QL Chat”

Who is online

Users browsing this forum: No registered users and 3 guests