Is it possible to programmatically simulate 3d mouse on mac? - macos

I would like to simulate 3D mouse operation to rotate/pan/zoom elements in "Blender" (on OSX).
Is it possible?
Thanks a tone for your help!

Take a look at this:
Mouse Button Emulation
Under File -> User Preferences -> Input, tick 'Emulate 3 Button Mouse'. The link shows the default shortcuts for an Apple one button mouse.

did you get to solve your problem? We're trying to rotate an Object via Java in another 3D App (3DVia). Since we couldn't find an API, we want to simulate a Space-Mouse. We tried the Java Robot class, but you can only move the primary mouse cursor.

Related

How to get values from a macOS built in Application Color Meter?

I am building a mini project where I want to have a color picker feature. I found the Digital Color Meter on macOS is helpful. I did some search and found I can write a simple AppleScript to activate the application.
It would be awesome if I can monitor the next left-click mouse event (even if I am not focusing Digital Color Meter application). By monitoring the next left-click mouse event, I want to get the value from the R, G and B options as you can see from the image above.
I think mouse event handler should be able to achieve (though I don't know how to do it). I am not sure whether I can read the value from the Application...
Simply use
choose color
from Standard Scripting Additions.
In the color picker window there is also a eyedropper (pipette).

Marble Trackman Scroll with holding Button only on Windows

I bought a Logitech Marble Trackman. I am used to hold one button and roll the ball to scroll under linux. Now I am working under Win8 and installed Logitech SetPoint.
Now I have Universal Scroll and AutoScroll as options and both lock the scroll function. I need a second click to deactivate scrolling.
Is there a way to scroll only with button 4 hold?
I found a solution after a long search.
It's this simple:
throw away LogiTech SetPoint
Install e.g. X-Mouse Button Control from http://www.highrez.co.uk/downloads/XMouseButtonControl.htm
Configure everything you want.
Poor Logitech.

Cocoa listening key events and responding them without view

First of all hi guys!
I was trying to write a mouse controller app for mac os x which is reading inputs from keyboard and moves the mouse accordingly. By garbage input i will describe the input was intented for a mouse event but it creates text on screen.
Before anyone points to the fact that there is a built in one, It was laggy even in shortest lag setting and cannot registers more than two buttons at the same time (you have to press diagonals to go to the diagonal.) If you accidentally press another button when release of the accident button your motion stops. My first and last reaction was "rubbish!". Adding customization and extra features is my goal.
I want to create a key combination that will block the garbage input to be passed to other programs while it was held. But global monitoring and seems like it always passes the event. And unfortunately I see qqqqqqqwwwwwww like text in unwanted places.
I want to see that when i press q w and up, it will make the mouse go up. But i create qqqqqqqwwwwww mess on the way. My first idea was creating a view on popover and handle events there, but whenever I want to use my mouse from keyboard seeing a popover is anoying and I couldn't find a way to show the popover without leaving any garbage keyboard input.
What should i do in this situation?
You will want to use Quartz Event Taps. Note that for an application to tap keyboard events, it has to be trusted for accessibility (as in System Preferences > Security & Privacy > Privacy > Accessibility). Your app can ask to be made trusted using AXIsProcessTrustedWithOptions().

Restrict mouse movement over a specified window handle

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 function to do this.
Confines the cursor to a rectangular area on the screen. If a subsequent cursor position (set by the SetCursorPos function or the mouse) lies outside the rectangle, the system automatically adjusts the position to keep the cursor inside the rectangular area.
You can poll the cursor position and correct it using a timer, but this is not ideal. You could also cover the top bar by a transparent topmost window. This way, input will never reach the top bar.
EDIT: If Internet explorer is an option you have the possibility to use the COM object to embed what you need in a custom application. Other browsers might have similar APIs, but I'm not familiar with them.

How to make stylus not control the mouse?

I want to separate the stylus position from the mouse position in a win32 application. I'm using the wintab sdk and I've seen articles about distinguishing between mousebuttondown/up events coming from the pen/eraser or mouse. But I haven't been able to find anything that lets you use the stylus as a second device. I want to respond to WT_PACKET events to determine the position of the pen for painting, and use the mouse cursor for other operations.
I figured it out.
LOGCONTEXT lc;
lc.lcOptions |= CXO_SYSTEM // this flag links it to the system cursor.
return WTOpen(hWnd, &lc, TRUE;
.....

Resources