I have a UWP app running on Xbox One. The app uses mouse pointer for navigation. It works well. One screen contains a video player that can be set to run fullscreen. When in fullscreen video playback, the mouse pointer does not disappear.
How can I make the mouse pointer programmatically disappear when the player enters fullscreen and appear when it exits full screen?
I found How Can I Disable Pointer Mode For Xbox One (C#, UWP) but it only handles global pointer set when the app starts.
Found a working solution, to hide the cursor, do Window.Current.CoreWindow.PointerCursor = null. First store the value somewhere of course so you can restore it when you need the cursor back.
Have you tried wrapping the media player in a custom user control on which you could say RequiresPointer = RequiresPointer.Never; whenever the player enters fullscreen?
I don't have an Xbox here at the moment to test it and it's been a while since I've wrote something for it. But this approach would be my first guess.
Related
I am writting a Windows Store App where you can draw lines on the screen and need to avoid the obstacles. To detect where exactly is user touching at the moment I use Canvas from Windows.UI.Xaml.Controls, because it contains events that are helpful here. But the problem is that PointerMoved event is very slow, and it's easy for user to draw on the obstacle and app does not detect it (if user draws over the obstacle fast enough)
Is there any way to speed it up, for example try to force this event to be raised after every (even small) pointer position change?
Thanks for any help!
I am working on a tools app and I need a way to turn on the camera flash when I click a tile, then keep it on in the background and turn it off once I click the tile again.
I don't need any help with the tile yet all I want to know is what I can do to turn on the flash and then keep it on. All the examples I have seen thus far simply pretend to be a camera and then turn the flash on.
Do you know of anything?
PS. I am planning on making this for WP 7 and 8 but if you know of a way that will on work on WP 8 that will also help me a lot.
The simple answer is no.
While the app is running, you can control the camera and turn on the flash. But as soon as you exit the app (Back button) or the app is suspended (due to a phone call or by pressing the Start button), the use of the camera is suspended.
Windows Phone does have Background Agents but these are very limited and do not allow access to the camera API at all (and many other APIs).
I would like to draw graphics that will reside above all other interfaces, including Windows 8 new Home screen. How would you go about doing that? With Windows 7 and down, it would be as simple as showing a transparent fullscreen window above all else, but now since the desktop is separated from the rest of the operating system it is not possible anymore.
The reason is that I need to display two cursors independent of the Windows mouse cursor. I am developing a multi touch simulation software for a Wii Remote (using the sensor bar pointer), and for the moment I just set the cursor position and wakes it by shaking +1 and -1 pixels. But it interferes with the touching, so I have to disable it when using the touch simulation. It works for the moment, but I would like to add multi touch support so that you can zoom and rotate with the Wii Remote. The touch function is ready, but you would want to see cursors for when holding one touch point and choosing the other touch point with the Wii Remote, and while holding the first touch point the Windows cursor aren't able to move anywhere else because it sticks to the touch point.
I have seen how to draw directly to the screen by aquiring a Graphics object for the screen, but it does not work since it is completely unmanaged, so the graphics stay visible until something else refreshes the area.
So, any suggestions?
The project involved is called Touchmote and is available as source code and installable beta on touchmote.net.
Demand the UIAccess integrity level in application manifest by specifying UIAccess=”true” in the requestedPrivileges attribute.
Make the window topmost (change the position via SetWindowPos or set the TopMost property in WinForms/WPF)
Sign the application using a digital certificate that chains up to a trusted root in the local machine Trusted Root Certification Authorities certificate store.
run directly (that is, not from a debugger) from a secure location in the file system. You can attach a debugger afterwards.
Note this make your application running elevated, you may have issues when you need to connect to your application from a lower integrity level.
There is already an interface for what you're trying to do: Touch Injection. You can specify that you have contacts in range but not in contact with the screen, and a little circle will appear on the screen. You don't need to draw the circles yourself; the touch system will do it for you.
I have been fooling around with screen capture for awhile now and I managed to capture the entire screen, certain areas on the screen etc...
But when I go into a game and try to capture the screen, it completely ignores the game and instead, captures the desktop (or whatever is behind the game window).
Another interesting fact is that the same thing happens with the PrtScn button.
Any ideas on how to capture a game's screen?
The screen capturing technique you are using works well for capturing things that aren't hardware accelerated. I suspect you'd have the same problem trying to capture a movie frame in Windows Media Player.
The solution is the do a screen capture from the hardware itself using DirectX. This article explains how to do that with some code and a managed wrapper around DirectX called SlimDX.
EDIT
If Slim DX doesn't work for you, then you'd just have to find another managed wrapper around Direct X. I don't think you are going to be able to do the screen capture without working at the hardware level, and DirectX is the means of doing that on the Windows platform.
I have a wpf window that has a height of 2000 with an actual desktop height of about 1000. Obviously about half of the window is off screen. Even though the window extends below the screen, the mouse will not move down to that area. I do want this content to be off-screen, and I want the mouse to be able to move over it and click on elements if the mouse is positioned over an element at that position. I don't want to change my screen resolution as some content absolutely has to be off the screen. Not sure how to go about this.
Cursor delimiting is not done by the application, but by Windows itself. To my knowledge there is no way to have your cursor pointing off the screen.
You could simulate what you want by doing what many games do. Do not draw the Windows cursor, draw a custom one in your app window. Force the real cursor (not being drawn) to stay in the center of the monitor. Every time the user moves the real cursor, move your application's cursor accordingly and re-place the real cursor to the center of the screen.
This will give the illusion of what you'd like, but I don't think WPF can handle this.
There is not an off the screen cursor position in Windows. I think the mouse is bounded by the screen resolution, even if windows are not.
If you take a look at the screen shots of MaxiVista you'll find a screen shot showing the Device Manager:
Device Manager http://www.maxivista.com/pics/screenshots/vista_devicemanager_en.gif
As you can see they simply wrote a virtual display adapter, which provides its own display size. So windows will be informed about a available size of e.g. 2560x1600 would be possible and allows these bounds for all windows and the mouse. Now it is up to the display driver to forward the right portions of this virtual screen to the current real display adapters so that the right part is shown on each physical device.
I think it is possible. This program will enable to use a secondary computer as an extra monitor. There are several programs that can let you know the coordinates where your mouse cursor is positioned. For example AutoIt will do that easily.
When you install autoit it comes with this utility that will let you know the cordinates where you position the mouse. When I took the screen capture the mouse does not show up but I draw a blue dot where the mouse was located. Note that the cordinates where 710, 1464. Right now my screen resolution is 1200 * 1920 (my monitor is rotated). So with Autoit I am able to position my mouse cursor by doing something like
When I run that autoit program it will move the mouse to that location. The answers to this question seem to be right cause I am not able to move the mouse any further than 1200 to the right. In other words executing MouseMove(2500,800) will result in moving the mouse to 1200,800. Now the interesting part is how come I am able to move the mouse to (2500,800)! if I use This program In other words executing MouseMove(2500,800) now works with Autoit and the mouse actually moves to the other computer (maxivista has to be running). maxivista shows that there can be a way of moving the mouse outside the resolution of your screen.