Long Press Gesture WatchKit - watchkit

I'm trying to add a long press gesture recognizer to my Apple Watch app. Reading the Apple's documentation (https://developer.apple.com/documentation/watchkit/wklongpressgesturerecognizer) is not clear to me whether there's a delegate I should implement or what else is triggered by the long press gesture itself. Could somebody help me ?

A Long Press Gesture Recognizer has to be dragged into a Storyboard from the Object library. From there, you Control-drag it to code to set an action connection, and handle long presses within that method.

Related

How to set a Slot receiving every Widget action in Qt

Suppose I've a Qt app based on QWidget, in which I'd like to obtain a "feedback" everytime I press a QPushButton, I rotate a QDial, I press a mouse button. My question is: how can I set a slot that informs me everytime something happened inside my app built for a touchscreen, in which I need to know when user does something on it.
MousePressEvent partially solves my problem; so when user touches the screen, MousePressEvent warns me about it. Problem is related to widgets as QPushButtons or QDials.
At the moment, I've already arranged my widgets with a lot of subwidgets; number of pushbutton is about 300. How can obtain triggering signal when one of them is pressed without re-edit every single button?
You can use an "event filter" that is installed on QApplication instance. This filter will receive all the events in your application, afterwards you can check event type and object type to pick the events you are interested in. See my answer to another question here for details.

Watchkit passcode button press detection

In the apple watch's passcode setting screen the passcode on top updates as soon as a user clicks on the buttons and not after lifting the finger. How can one achieve that in Xcode 6.3? Because the only event that triggers the ibaction is the touch up event
I don't think that behavior is possible with the current version of WatchKit. Apple is likely using their own internal method to accomplish that (as they do with many/most of the default Watch apps). Hopefully we'll get more functionality in the next major update.

Recognize a holding/long touch on a list component in Flex Mobile

I´am trying to create my own custom list component in a Flex mobile Project which fires an Event when the user touches a listitem and holds the finger down for a given time.
Some kind of "longTouch"-Event like its implemented on native android listitems to edit the entry for example.
I tried to listen for the MOUSE_DOWN Event to start a timer and dispatch an event when the timer finished. But this approach failed because i cant get the listitem that was pressed by the user because the List component updates the "selectedItem"-property only after the user lifts his finger from the list.
thanks in advance
Andre Uschmann
There is no longTouch (or longPress) event exposed through the Flash Player Native APIs.
One option is to roll your own using TOUCH_BEGIN, TOUCH_END, and a timer.
Basically:
When user starts the touch, start the timer.
When the touch_End event fires; check the timer to see how long it has been running using currentCount. If it is long enough to be considered a "long touch", then dispatch your custom longPress event. If not; then stop the timer and ignore.
This could all happen inside the renderer; so you'd know exactly what item was pressed.
I expect this would be more solid than using mouse events, which seem to be inconsistent on touch based devices

Getting the keyevent info from Virtual Keyboard of symbian touch devices

Is there any way to obtain the keypress info for the green-tick (green check marked key) present in the input panel/ virtual keyboard?
Our application is for symbian touch devices. In my application I wanted the url to start loading as soon as the QLineEdit has been edited i.e., as soon as the green check marked key in VKB has been pressed.
I tried using the CloseSoftwareInputPanel event to get notified when the editing is completed in the QLineEdit i.e., when the green check marked key is pressed in the VKB, but that event occurs only after the QLineEdit loses focus (when I tap anywhere on the screen). Is there any other way to get it done?
Thanks
The virtual keyboard is implemented as a front-end processor (FEP) and it's quite invisible to applications.
Note that there are Symbian touch devices that also have a physical keyboard. Not for those devices alone, you should have a Go button or similar and observe returnPressed signal.

Flex: Simulate key press

I'm creating a virtual keyboard for a touchscreen Flex app and i'm trying to simulate a key press by dispatching a KeyboardEvent. I've written a handler function to listen for the event and act accordingly. So far so good... but it's starting to get complicated as i have to manage the focused textInputs (easy), the cursor position in those fields (not to so easy), etc.
Now, if only there was a way to actually dispatch a KeyboardEvent that Flex would actually interpret as a genuine key press all those issues would be gone... Is that possible?
The TextInput does not use KeyboardEvent/TextEvent for text input, it uses internal Flash TextField objects that interact with the Flash Player / Keyboard.
The KeyboardEvent are used to enable notification of the Keyboard Event that occured.
To simulate a keyboard, you will need to create a class that upon recieving a KeyboardEvent will modify the text property of a TextInput and the cursor position accordingly.
Alex Harui has written a similar post about this FlexCoders Post

Resources