English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 13 August 2016, 12:47   #1
BSzili
old chunk of coal
 
BSzili's Avatar
 
Join Date: Nov 2011
Location: Hungary
Posts: 1,300
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 13:04. Reason: removed OS4 stuff I found by mistake
BSzili is offline  
Old 13 August 2016, 21:25   #2
voxel
Amiga Nuts!
 
voxel's Avatar
 
Join Date: Sep 2006
Location: Le Mayet d'Ecole, 03800, FRANCE
Posts: 176
mouse port is port 0, joystick port is port 1 by default. if I remember well ^^)
voxel is offline  
Old 13 August 2016, 21:51   #3
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,028
Quote:
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 13 August 2016, 23:25   #4
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
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, 14:17   #5
BSzili
old chunk of coal
 
BSzili's Avatar
 
Join Date: Nov 2011
Location: Hungary
Posts: 1,300
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, 16:43   #6
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,381
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 offline  
 


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 12 October 2014 23:36
Serial port, parallel port, and pipe device mount errors Samurai_Crow support.FS-UAE 4 13 March 2014 00:04
(ASM, C ) input.device Asman Coders. General 4 16 July 2009 10:10
Shortcut to swap input port... mauro72 support.WinUAE 1 15 May 2009 15: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 10:34.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.08358 seconds with 13 queries