English Amiga Board

Go Back   English Amiga Board > Coders > Coders. System

Thread Tools
Old 13 August 2016, 13:47   #1
Registered User

BSzili's Avatar
Join Date: Nov 2011
Location: Hungary
Posts: 289
Find out input.device mouse port

The IND_SETMPORT input.device has a command can be used to pick the mouse port, but there's no matching command to query which port it collects the mouse events from. Is there an alternate way to find the port number used by input.device?

Last edited by BSzili; 13 August 2016 at 14:04. Reason: removed OS4 stuff I found by mistake
BSzili is offline  
Old 13 August 2016, 22:25   #2
Amiga Nuts!
voxel's Avatar
Join Date: Sep 2006
Location: Le Mayet d'Ecole, 03800, FRANCE
Posts: 177
mouse port is port 0, joystick port is port 1 by default. if I remember well ^^)
voxel is offline  
Old 13 August 2016, 22:51   #3
Registered User
thomas's Avatar
Join Date: Jan 2002
Location: Germany
Posts: 5,868
Originally Posted by voxel View Post
mouse port is port 0, joystick port is port 1 by default. if I remember well ^^)
Your reply is not helpful. Both Amiga game ports have the same features. They both can handle either a mouse, a joystick, a pair of paddles or a CD32 game pad. It's just a convention that port 0 is used for the mouse. As BSzili pointed out, there is a command which lets you tell input.device which port to query for the mouse. But AFAIK there is no way to find out which port is currently active.

Of course it is 99% sure that port 0 is the mouse port, because this is the default and almost nobody changes it. But it is possible to change it and therefore you cannot be 100% sure.

Well, you could try to check with lowlevel.library which port has a mouse. But if two mouses are connected, you are lost again.
thomas is offline  
Old 14 August 2016, 00:25   #4
Join Date: Jul 2008
Location: Sweden
Posts: 2,265
Have a look at gameport.device, it's the device that reads the gameports and feeds the data to input.device, there might be something in there.
Leffmann is offline  
Old 14 August 2016, 15:17   #5
Registered User

BSzili's Avatar
Join Date: Nov 2011
Location: Hungary
Posts: 289
Thanks for the replies. Lowlevel.library's auto-detection can be a bit cranky at times, which is why I was looking for a way to find out which port input.device listens to. Sending a GPD_ASKCTYPE command to gameport.device units 0 and 1 did the trick, whichever says GPCT_MOUSE is the one used by input device.
BSzili is offline  
Old 17 August 2016, 17:43   #6
Registered User

Daedalus's Avatar
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 4,292
Yep, if the mouse is in a certain position and not moved during the detection routine, it's impossible to tell the difference between it and a standard joystick, so joystick will be assumed.
Daedalus is online now  

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Input Device Clash Hungry Horace support.FS-UAE 2 13 October 2014 00:36
Serial port, parallel port, and pipe device mount errors Samurai_Crow support.FS-UAE 4 13 March 2014 01:04
(ASM, C ) input.device Asman Coders. General 4 16 July 2009 11:10
Shortcut to swap input port... mauro72 support.WinUAE 1 15 May 2009 16:45

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 17:56.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.06604 seconds with 15 queries