How to pin mouse in center of screen with GLUT? - event-handling

I want to pin my mouse in middle of screen I mean when user move mouse the only thing that he see is rotation in environment also mouse cursor never reach window border ...
I want to handle my camera with mouse but when mouse reach window border or in full screen mode screen border the mouse position doesn't change but camera should still rotate slow or speedy depend on speed of mouse movement...
How should I solve this problem?

SDL_warpmouse can accomplish this. If you are looking for an OS-specific way to accomplish this, consider viewing SDL's source code.

Related

how can I undo this mode in the unreal engine 4.27

I'm new to ue4 and while working on a project have clicked on something that turned the 3D viewspace which is movable with right click plus w,a,s,d, I changed some mode (I believe) so that it turned to a 2D space which I can move only right and left, up and down and zoom in or out, but cannot tilt the camera. TRight clich and drag gives me some measurement of distance I believe.
How do I return to the default mode of view in ue4?
Thank you all in advance!
below is the screenshot of how my editor looks like right now
You just accidentally changed your Viewport Mode.
It's as easy as clicking that little car button with the text that says "Back", which will open a dropdown. Then choose "Perspective" or whatever applies to you. It's at the top left corner of the viewport window, right below the "Save Current" button.

Dealing with Popup in Corona game engine

I have a screen in Corona to display a puzzle, and once user guess the correct answer, I'm going to display a simple pop up on the screen to do the congratulation a long with close button to dismiss the popup, now I need for a simple work around to disable any control or behaviour on the original screen while displaying the popup, how can I do that?
I think you need to do this by stop or pause transitions, timers and animations etc. before you go to scene with pop up.
You can add transparent rectangle from transparent image file (not just rectangle, as it will not be touchable).
Size of this rectangle must be the size of all screen.
Position of rectangle - under your popup (or better make it as part of your popup).
Add listeners to this rectangle on touch and tap that will just return false - so it will prevent any clicks under it.
That will save you from pausing / disabling buttons, that you don't want to disable/pause.

Pixelwise scrolling for LO/OO Writer

In LO/OO Writer vertical scrolling can be done e.g. by moving the text cursor up/down, using the mouse wheel, clicking the up/down arrows on the vertical scrolling bar, etc.
Touch scrolling (on touch screens) is not supported, unfortunately. Therefore I wrote a tool (in Autohotkey) which enables touch scrolling. It is working fine, but the scrolling is not as smooth as in other programs supporting touch scrolling: the content of the window is moved in steps of approx. one line.
In my tool I am using the best 'control' for scrolling I could find: touch point movements are remapped to clicks on the up/down arrows on the vertical scrolling bar.
MY QUESTION: Is there (could there be) another 'control' in LO/OO Writer which would allow smoother (pixelwise) scrolling of the displayed content?
Thank you very much in advance for your answers! (Please only answers referring to LO/OO Writer.)
Clicking and dragging the scrollbar allows higher granularity than the up/down arrows. The scroll amount adjusts if the document is zoomed in.
On the downside, using the scrollbar is much more difficult than a simple click on the arrows. There is a discussion at https://autohotkey.com/board/topic/51041-click-drag-scrollbars/.
If it is a touch screen, perhaps you could require the user to touch the scrollbar, so the touch location would give the vertical position of the scrollbar. Then use MouseClickDrag starting from that position.

How to use rotate 3D in a matlab figure without losing focus?

So basically, I'm using matlab to simulate several lines and points in a plot3 figure.
When I'm trying to navigate the result using then "pan" command, I want to focus on a particular part, but EACH time I try to rotate around the point I'm focusing, I lose the focus and it rotates around the center of the figure. Is there any way to keep the focus when switching between commands to rotate 3d?.
When I use zoom and then I use pan, I don't lose the focus.
When I use pan and then I use zoom, I don't lose the focus.
When I use pan and then rotate 3d, I lose the focus, and I rotate around the center of the plot/figure.
When I use zoom and pan and then rotate 3d, I lose the focus, and I rotate around the center of the plot/figure.
Is there something wrong with the rotate 3d command? Is there an option I can change?
Thank you!

Best way to animate a spinning wheel thats responsive to touch events

I need guidance towards the right direction to take here.
I want to build a spinning wheel control where a user can select an element.
I want to accomplish the following:
Receive touch events that will rotate the wheel based on the finger position in touchesMoved
Magnify the image that is inside the selected image indicator when it passes through.
I was thinking of a core animation Basic Animation and animating the rotation.
Using an animation group and rotate it around.
Problem 1:
How do I sync the animation to the touch events.
Problem 2:
How will I know which image is the one I need to magnify with for example an CGAffineTransformMakeScale.
Is there a best practice for my problem. Esp. with performance in mind?
http://img24.imageshack.us/img24/8596/imagezy.png
You can achieve this by update the wheel for every touchmoved event.
For each touchmoved, touchbegin event, you can know the angle of the line from center of the wheel to your finger. You save your begin angle, then you will know the diff angle. The wheel can rotate depends on your finger by using angle.
you can enlarge the image icon by either of these two ways.
1. You can know which image icon angle in all the wheel, and you also know current angle of the wheel. So, if the image icon is between the right angle. Ex. if wheel is at 45 degree, then icon at -45 or 360-45 degree will be enlarged.
2. check the y origin of each image icon, if the image icon origin y is above threshold.