mouse

Multiple mouse/mice/cursor?

最后都变了- 提交于 2019-12-02 03:19:36
问题 How can I show another cursor for multiple mice? I have two TMemos, two keyboards which can type into their respective TMemo, 2 mice and I need 2 cursors those. If hypothetically, I can already detect which mouse is which. How can I make my own cursor to go along with it. (using Delphi) Possibly along the lines of Multipoint as an alternative, is there any software which can render more that one cursor. Like CPNMouse? EDIT: I found that I can use the mouse_event Function in windows, but I

I cannot access Position of the cursor (move mouse programatically)

≡放荡痞女 提交于 2019-12-02 03:09:07
this is my code: private void MoveCursor(int x, int y) { // Set the Current cursor, move the cursor's Position, // and set its clipping rectangle to the form. System.Windows.Forms.Cursor cursorMouse = new System.Windows.Forms.Cursor(System.Windows.Forms.Cursor.Current.Handle); cursorMouse.Position = new System.Drawing.Point(x, y); System.Windows.Forms.Cursor.Clip = new System.Drawing.Rectangle(cursorMouse.Position, cursorMouse.Size); } This is what my console says: Error 11 Member 'System.Windows.Forms.Cursor.Position.get' cannot be accessed with an instance reference; qualify it with a type

Move a window on keypress + mouse (like linux ALT + mouse down)

僤鯓⒐⒋嵵緔 提交于 2019-12-02 02:46:53
Simple, i want to move a windows pressing ALT+MOUSE, like linux os (ALT+drag). It's possible to pass a win32 api (move api) to the windows interested clicking on it? I have a windows services that hook key pressed (ALT button in specific). When ALT key is pressed and a mouse down event is verified, i want to move window clicking anywhere, not only on the title bar! Currently i move my form windows in this way: using System.Runtime.InteropServices; [DllImport( "user32.dll", CharSet = CharSet.Auto, SetLastError = false )] static extern IntPtr SendMessage( IntPtr hWnd, uint Msg, int wParam, int

Multiple mouse/mice/cursor?

拟墨画扇 提交于 2019-12-02 01:08:14
How can I show another cursor for multiple mice? I have two TMemos, two keyboards which can type into their respective TMemo, 2 mice and I need 2 cursors those. If hypothetically, I can already detect which mouse is which. How can I make my own cursor to go along with it. (using Delphi) Possibly along the lines of Multipoint as an alternative, is there any software which can render more that one cursor. Like CPNMouse ? EDIT: I found that I can use the mouse_event Function in windows, but I still don't have the visual representation of the cursor. Cursors are just resources. Here is a good list

Why is a camera rotated around z-axis in Unity3D?

馋奶兔 提交于 2019-12-02 00:57:40
I have a main camera in Unity3D that I want to rotate depending on mouse input, so it works as a first person video-game where you move the mouse depending on where do you want to look at. The starting values of the camera (Transform tab in Inspector tab in Unity) are: Position : X = -1, Y = 1, Z = -11. Rotation : X = 0, Y = 0, Z = 0. Scale : X = 1, Y = 1, Z = 1. I added a Script component for the Main Camera. And it is the following class: using UnityEngine; using System.Collections; public class CameraMove : MonoBehaviour { float deltaRotation = 50f; // Use this for initialization void Start

SDL Mouse Click

微笑、不失礼 提交于 2019-12-02 00:36:22
问题 So, I'm currently working on an options menu for my game, I have a button that when pressed it changes it's text to the next resolution in an array, so basically the user presses this button to change their resolution to the next string in the array. My problem is getting the click event. Right now, when the user presses the button, it returns true while the mouse is down, instead of when the mouse is pressed. I want to only return true in the mouse event when the mouse is pressed. I've

Restrict mouse movement over a specified window handle

房东的猫 提交于 2019-12-02 00:19:29
I'm looking to simulate a kiosk mode for Safari on Windows. OSX will not work with my input hardware and Chrome's GPU acceleration is too slow for the machine I'm using. The only plausible solution [so far] is to run Safari and send an F11 (fullscreen) keystroke, but prevent the URL bar from expanding when the mouse reaches the top pixels of the screen. I've looked and can't seem to find any good solution and would like to know if I can restrict the cursor movement from reaching the top pixel of the screen? If anyone has any other solutions, that would be great! You can use the ClipCursor

How to get mouse cursor icon VS c++

天涯浪子 提交于 2019-12-01 21:16:38
问题 I use this code to get mouse position on screen and it's working. I also get cursor width and height. What I need is cursor icon in the moment I call function GetIconInfo. In ii iI have ii.hbmColor and ii.hbmMask. Value of hbmColor is 0x0, hbmMask is 0x2f0517f1. Can I extract mouse cursor from that two pointer and how? CURSORINFO cursorInfo = { 0 }; cursorInfo.cbSize = sizeof(cursorInfo); HDC memoryDC = (HDC)malloc(100); memset(memoryDC, 0x00, 100); if (::GetCursorInfo(&cursorInfo)) {

pygame mouse.get_pos() not working

末鹿安然 提交于 2019-12-01 20:30:41
问题 I can't get a very simple pygame script to work: import pygame class MainWindow(object): def __init__(self): pygame.init() pygame.display.set_caption('Game') pygame.mouse.set_visible(True) # pygame.mouse.set_visible(False) # this doesn't work either! screen = pygame.display.set_mode((640,480), 0, 32) pygame.mixer.init() while True: print pygame.mouse.get_pos() pygame.mixer.quit() pygame.quit() MainWindow() This just outputs (0,0) as I move the mouse around the window: (0, 0) (0, 0) (0, 0) (0,

How to get mouse cursor icon VS c++

百般思念 提交于 2019-12-01 19:41:11
I use this code to get mouse position on screen and it's working. I also get cursor width and height. What I need is cursor icon in the moment I call function GetIconInfo. In ii iI have ii.hbmColor and ii.hbmMask. Value of hbmColor is 0x0, hbmMask is 0x2f0517f1. Can I extract mouse cursor from that two pointer and how? CURSORINFO cursorInfo = { 0 }; cursorInfo.cbSize = sizeof(cursorInfo); HDC memoryDC = (HDC)malloc(100); memset(memoryDC, 0x00, 100); if (::GetCursorInfo(&cursorInfo)) { ICONINFO ii = {0}; GetIconInfo(cursorInfo.hCursor, &ii); BITMAP bm; GetObject(ii.hbmMask,sizeof(BITMAP),&bm);