Detect the Touch pad status(ON/OFF) in UWP - windows-store-apps

I want to detect the touch pad status whether it is on or off in the UWP application.on search i am to find only the click event which does not meet my requirement.

You can use the TouchCapabilities class's TouchPresent property to see if a touch device is present
https://learn.microsoft.com/en-us/uwp/api/Windows.Devices.Input.TouchCapabilities

Related

What is the use of VIDEOEXPOSE in pygame?

I dont really understand the utility of this event type. It seems to appear at the same time as the VIDEORESIZE event but it does not have any attribute like the QUIT event. The official documentation of pygame events does not talk about this one http://www.pygame.org/docs/ref/event.html... Does anyone know why this event type was created ?
From the pygame.display documentation:
Hardware displays that draw direct to the screen will get pygame.VIDEOEXPOSE events when portions of the window must be redrawn.

is it possible to pin AIR app over any opened windows?

I need to pin AIR application over other windows, I mean, regardless if AIR application is in focus or not, it must not hide, it always must be shown, whatever other program I activate or work with, AIR application must be over every window always. Is it possible? If it is, please show me the function (example code will be better :) ) which does it, incase if AS3 has one.
You're looking for the alwaysInFront property of the NativeWindow class:
The alwaysInFront property specifies whether this window will always be in front of other windows (including those of other applications).
The following example forces a window to be displayed in front of all
other windows (that are not similarly forced to the front):
windowObj.alwaysInFront = true;
Another example with a reference to a display object on the window stage:
displayObject.stage.nativeWindow.alwaysInFront=true;

How does TVJS detect swipes on the Apple TV remote?

I am building an app using TVJS and TVML for Apple TV. Is there an event to help me detect when the user has swiped the siri remote's touchpad? When I'm showing an image full-screen and the user swipes, I want to move to the next/previous image. But I can't seem to find any event for detecting these swipes. Thanks!
I don't think that you can 'detect these swipes' and react with them manually, TVML and TVJS use standard templates and have particular interactive components that can be laid out on screen and then the Apple TV handles moving between those elements by interpreting the commands from the control.
TVJS only allows you to listen to a limited number of events
enum TVElementEventType : Int {
case Play
case Select
case HoldSelect
case Highlight
case Change
}
You should be able to use the functionality you described by using the correct templates or elements, such as the OneUp template.
Without knowing how you've implemented this so far, there isn't anything else I can recommend. please show the code you are using for more accurate advice

Handling a keyboard event in one place for the whole program

I'm creating a little developer console for an AS3 AIR application, I'm wanting F12 to add the toggle the display of the console screen but I don't want to litter my program with a bunch of calls to the Console to show or hide it, I also don't really want to be re-creating the console on different screens of my application.
I'm wondering if there's a way or a place I can put my keyboard event to toggle the display that will handle it across the entire application? At the moment I've tried putting it into my Main class which calls the first screen in the hopes that would be able to handle it but as soon as I click on another screen my eventListener isn't called.
Any ideas?
You could add your event listener to FlexGlobals.topLevelApplication instead of specific views, this would achieve the reduction you require
For true application level keyboard handling, attach the listener on the NativeApplication.nativeApplication object.
NativeApplication.nativeApplication.addEventListener(KeyboardEvent.KEY_DOWN, toggleDevConsole,false,0,true);
Attaching the listener to the stage will only work when that particular stage (window) has the focus. This will become an issue if your application has multiple windows that require interaction.
For single window applications, either will work.
Woops, I'm not quite with it today!
For future reference I added the event listener to the Stage in my Main function and it's being picked up every time.
stage.addEventListener(KeyboardEvent.KEY_DOWN, toggleDevConsole, false, 0, true);

AS3 GestureEvent vs TouchEvent.TOUCH_BEGIN +TouchEvent.TOUCH_END

Creating an application that requires BOTH gesture(swipe) support as well as simple touch events. I understand that one limiation of the built-in touch support in actionscript is that you must choose either Gesture OR Touch events as input.
So I was wondering if you can easily simulate gesture events using the TouchEvent.TOUCH_BEGIN +TouchEvent.TOUCH_END events? Are they essentially the same thing as using Gesture events?
I believe you'll be able to simulate the gestures appropriately by using the touch events. Each time a finger goes down a temporary id is assigned to it so you can easily tell if this is the first or second finger down. In terms of them being the same, it's not exactly the same since the GestureEvents seem to be all dependent on the mobile OS to report as gestures instead of just as touches so any calculation for deltas (or whatever else) would be handled by the OS already instead of you doing it (with the overhead of the VM). http://help.adobe.com/en_US/as3/dev/WS1ca064e08d7aa93023c59dfc1257b16a3d6-7ffd.html
Try making gestureevents with touchevents. There are lots of properties that can easily be converted / combined.