How to keep ButtonR2 and mobile touch from registering MouseButton1Down()

Hey guys,
So I’m making a game that’ll have multi-platform support over mobile, pc, and xbox. I noticed that the gamepad’s ButtonR2, and mobile’s screen touch both register the mouseButton1Down function. This kinda messes me up because I wanted to have a gui layout for mobile that would allow finger dragging on the right to look around, but drag on the fire button and the gun will start to shoot.

I was wondering if there was a way around this? I was going to use a hacky platform detector:

local InputService = game:GetService("UserInputService")
local Platform = nil

if ( InputService.TouchEnabled == true ) then

	local DeviceSize = workspace.CurrentCamera.ViewportSize; 

	if ( DeviceSize.Y > 600 ) then
		Platform = "TABLET"
	else
		Platform = "PHONE"
	end

else

	if ( InputService.KeyboardEnabled == false ) then
		Platform = "CONSOLE"
	else
		Platform = "DESKTOP"
	end

end

and then I’d just run the mouseButton1Down:connect() if the platform is PC, but I don’t really like how that works, and I think I also might run into errors on mobile when running the game in lower resolutions on computers. Any ideas?

Edit:
Here’s what I’m trying to recreate:

You can hold down the bullet icon to fire, but if you drag it’ll still turn your camera. I don’t think it’s possible to do this with image buttons at the moment, and making it happen would have to be some hacky alternative. At the moment, adding mobile support feels very nasty - but crucial to the development of my game.

Have you tried UserInputService.MouseEnabled to determine if it’s a mobile device? No mouse and a touch screen is a lot more likely to be a phone than just touch and a small screen.

Regardless of what your solution to the issue is, that’s a really bad way to detect the platform of a device. Under those condition, my laptop, which has a touchscreen, would be classified as a tablet.

Does roblox support laptop touchscreens? I’ve never tried it before.

Yeah, those kinds of laptops have a way to swap between tablet and desktop mode with windows 10, and in tablet mode, the keyboard input is still recognized iirc.