Questions tagged [mouse]

A very common input device in computer games. It offers a more direct form of movement compared to directional input.

Filter by
Sorted by
Tagged with
23 votes
1 answer
9k views

Isometric rendering and picking?

I've been looking for a formula to plot (world->screen) and mouse pick (world->screen) isometric tiles in a diamond-shaped world. The ones I've tried always seem to be, well, off. What's the usual/...
mpnk121's user avatar
  • 547
13 votes
2 answers
16k views

How do I generate projectiles toward the mouse pointer? [duplicate]

I'm making a top-down space shooter where the player controls a ship and can aim and shoot using the mouse cursor. How can I fire bullets from the ship at the angle from the ship to the mouse cursor?
Tristan Dubé's user avatar
14 votes
2 answers
20k views

Is it possible to detect two different mice at the same time, and have their movements recorded separately?

I'm thinking of making a game that requires two mice to play. It needs to register the movements separately from one another. Is this possible? Or does the Windows architecture not allow for such ...
Bart's user avatar
  • 141
37 votes
1 answer
7k views

Mouse aim in an FPS

I would like to make a First Person Shooter and move the camera with the mouse. The problem is that when the cursor reaches the limits of the screen, the camera won't turn anymore. How can I keep the ...
BlackBear's user avatar
  • 506
5 votes
1 answer
5k views

Mouse location is off due to camera

I'm building a top down shooter but I have a little issue with my camera and mouse. When I add the camera that I use to my game (see here) my mouse pointer seems to be in the wrong location. When I ...
Bert 's user avatar
  • 53
1 vote
1 answer
591 views

How can I attract & repel the mouse cursor from particular UI controls?

This question came from some of my students. I wanted to share it here so others can find & improve on the solutions we've found so far. In particular, my answer below doesn't behave as well as I'...
DMGregory's user avatar
  • 134k
3 votes
1 answer
3k views

How can I detect mouse events on sprites in a canvas?

I'm making an HTML 5 game. I want mouse clicks on sprites drawn in a canvas element cause events that my code can react to. At the moment, I'm doing it by checking through all of my sprites in a for-...
aaa111's user avatar
  • 163
0 votes
1 answer
2k views

Trying to get an object to move in the mouse direction XNA C#

Right, so in my Player class where I call the object I got an if statement which gets the coordinates for the mouse ...
Pavvel's user avatar
  • 29
17 votes
6 answers
24k views

How to properly differentiate single-clicks and double-click in Unity3D using C#?

What I am trying to understand and learn here is a very basic thing: what is the most general and most polished way to properly differentiate single-clicks and double-clicks for the 3 main mouse ...
Bennton's user avatar
  • 365
8 votes
3 answers
21k views

How do I simulate the mouse and keyboard using C# or C++?

I want to start develop for Kinect, but hardest theme for it - how to send keyboard and mouse input to any application. In previous question I got an advice to develop my own driver for this devices, ...
Dracontis's user avatar
  • 229
7 votes
1 answer
8k views

Trap mouse in SDL2

When using SDL 1.2 it the way to implement full screen or windowed applications with "no cursor" you did the following: ...
rioki's user avatar
  • 2,866
7 votes
3 answers
10k views

How do I read input from multiple keyboards/mice on one computer?

I want to be able to read inputs from multiple keyboards and still differentiate them. It's for split-screen. I know it's possible, because Serious Sam 3 allows it. Edit : Well a whole lot of my ...
DevilBlackDeath's user avatar
2 votes
2 answers
3k views

LWJGL multiple keyboard/mouse input checks

As in many game libraries such as LWJGL, you can check mouse/keyboard events with Mouse.isButtonDown or Keyboard.IsKeyDown. I want to check for button/key presses, not if it's currently pressed down (...
Basaa's user avatar
  • 1,053
2 votes
1 answer
407 views

Turning to face mouse

Given three points on the same Y plane; A ship A point along the ships heading A mouse cursor How can I find which direction and angle the mouse cursor is from the ships heading? I have a limited ...
salmonmoose's user avatar
1 vote
1 answer
1k views

Bounding Box in Monogame for mouse picking

Hello guys so I'm implementing this mouse manager to be able to pick up objects. My application uses mainly textured quads in 3d space. I'm using bounding boxes in monogame to do so, however my ...
Roger Martins's user avatar
1 vote
1 answer
2k views

How to see which mouse button was pressed (Unity Input System)

I have switched my game to use the new Unity Input System, and I want to know which mouse button was pressed when an action is called. Here's how it's set up: Whenever one of these three mouse ...
caleidon's user avatar
  • 561
1 vote
0 answers
338 views

Unity Input System: How to handle input from specific device types when the binding abstraction fails?

Is there a way for Input System code to determine what kind of device generated an Input Action's current event, so that it can be filtered based on device type? The example I have is an Orbit Camera ...
davidA's user avatar
  • 141
1 vote
1 answer
510 views

Responding to mouse input on game objects

I'm trying to make a simple button in unity using a cube. My plan is for when the cube is highlighted that it will move towards the camera and be highlighted in a specific color and then when it is ...
Jameion's user avatar
  • 11
0 votes
0 answers
26 views

How to detect two different mice at the same time, and record their separate movements? [duplicate]

I would like to use two computer mice simultaneously, and to record data their separate movements on windows. I have successfully used TeamPlayer to create two cursors, but the software that I am ...
Lizzie Yarwood's user avatar
0 votes
1 answer
254 views

Get on what tile has mouse clicked

I am writing a chess game using Java and Swing, And I wanted to get the tile position on which a mouse clicked. I searched through internet, but all of them were really off, and never accurate. When I ...
anonymous's user avatar
0 votes
1 answer
945 views

Bounding Box in Monogame for mouse picking - Ray perspective

My mouse ray is screwing up precision. I don't really know how to fix it, maybe you guys can help. problem : (5.6mg gif) https://www.dropbox.com/s/v0z67afso88hsd1/perspective_ray.gif how i create ...
Roger Martins's user avatar
0 votes
2 answers
156 views

How to panning camera on XZ axis with different angles

I have an Orthographic camera where the position is { x:0, y:100, z:0 } and is pointing/looking at { x:0, y:0, z:0 }. At this ...
Enzo's user avatar
  • 115
0 votes
1 answer
182 views

Lowering Unity launcher graphic quality settings reduces mouse x turn speed, does quality affect time?

Lowering Unity App quality settings reduces mouse x turn speed, how to fix this? I am not sure why this happens my only thought was time.timedelta is affected by the graphics quality setting in unity ...
TeachMeEverything's user avatar
0 votes
1 answer
895 views

How to make my character walk by clicking and holding the mouse button?

I created an Action Mapping using the right mouse button as a reference. The Action Map is called "Andar" (walk in english). In the character code, I call this Action Mapping and in it I make the ...
Boneco Sinforoso's user avatar
0 votes
1 answer
421 views

Transfer mouse movements to a GameObject in 3D according to camera position and rotation

I'd like the game object to follow the mouse but I have trouble doing this when the object is in 3D and the camera has been rotated. The only thing that seems to be true (and still it works only when ...
nalka's user avatar
  • 115