TransformGestureEvent and TouchEvent
Is it possible to use the TransformGestureEvent and the TouchEvents at the same time? Or perhaps one recommended for commutation of the Multitouch.inputMode?
I saw this option in class of third party but without trying to enterpit the Gestuers of TouchEvents manually, I don't know what to do.
Thank you
D
Hi Donald,.
Failed to receive the two touch events and events the gesture at the time, but only one or the other based on the Multitouch.inputMode. Depending on your use case, you can either use key events and interpret as gestures when necessary or use mouse events and gestures events. Can you provide us with some details about your use case?
Thank you
Evtim
Tags: Flex
Similar Questions
-
TouchEvent injection application that runs in the background
Hello
I have a problem with the injection of TouchEvent.CLICK and TouchEvent.UNCLICK from an application that is in the background at the time of the injection. If my application is in the foreground, everything works fine. My logs, I see that the injection goes smoothly, but there is no effect on the foreground app. KeyEvent injection works as expected when it is injected background or foreground.
Tested on Simulator 9550 and 9700 device, the two OS 5.0, also compiled for OS 5.0.
Is this expected behavior? Is there a solution?
Thank you very much
Eva Rezkova
Hello
Finally, I found the solution. So far I inject me like this:
event = new EventInjector.TouchEvent(EventInjector.TouchEvent.CLICK, x, y, -1, -1, -1);EventInjector.invokeEvent(event);event = new EventInjector.TouchEvent(EventInjector.TouchEvent.UNCLICK, x, y, -1, -1, -1);EventInjector.invokeEvent(event);
It works well in my own application and in the situations I have described before.
It works as expected if I inject the event like this:
event = new EventInjector.TouchEvent(EventInjector.TouchEvent.DOWN, x, y, -1, -1, -1);EventInjector.invokeEvent(event); event = new EventInjector.TouchEvent(EventInjector.TouchEvent.CLICK, x, y, -1, -1, -1);EventInjector.invokeEvent(event); event = new EventInjector.TouchEvent(EventInjector.TouchEvent.UNCLICK, x, y, -1, -1, -1);EventInjector.invokeEvent(event); event = new EventInjector.TouchEvent(EventInjector.TouchEvent.UP, x, y, -1, -1, -1);EventInjector.invokeEvent(event);
Thank you much for the help.
Eva Rezkova
-
My FieldChangeListeners are no longer works
Hello
My code is too long to post here so I'll try to explain. I've built a number of calculators with EditFields and ButtonFields, that work well. The ButtonFields have FieldChangeListeners that do things when they are clicked.
The last calculator to build I added a few TextSpinBoxFields in a PopupScreen. I used the SpinnerDemo to help with the code. So I can make a selection of spinners OK, but now my ButtonField listeners are no longer works. When I click a button the pop-up menu main upwards instead.
Part of the code SpinnerDemo a navigationClick() and touchEvent() overloaded, so I wonder if they caused the problem.
If anyone can help with this I would be very happy.
Ah, Yes. The custom button class is indeed a problem. You need to make it react to the touch of the events. To remove the context menu, you need to uncheck as well as click on the events button. Something like this should do it:
protected boolean touchEvent(TouchEvent message) { switch (message.getEvent()) { case TouchEvent.CLICK: fieldChangeNotify(1); // fall through case TouchEvent.UNCLICK: return true; } return super.touchEvent(message);}
-
Event management at PopUpScreen
Hello
In my application, I have a main screen and pop-up on-screen display on the main screen. In Pop up screen I have buttonfiled and bitmapfiled when I manage the touchevent this filed is not execuated.
How to handle the event of the pop ip field of the touch screen?
It is resoved by the method navigationClick() and touchEvent() of the basis of the management screen and the default menu now not invoke.
-
Hello
I need a floating animation with a few clickable image screen, the user can drag and click.
But I have no idea to one! Is there some API animation to do this?
Any advice will be useful.
Thank you.
The general idea is the following:
(1) have a custom layout manager which positions its children to the desired position. Here's a decent example of the forums - take a look at the sublayout method:
AbsoluteFieldManager on pre-5.0 OS
Keep the coordinates (X and Y) of the field 'mobile' to some members of the class and taken over the sublayout members.
(2) alter these coordinates field on every event that should cause the field to move, then call updateLayout(). These events may include navigationMovement and TouchEvent.MOVE (read getMovePoints - it is pretty well documented).
Enjoy!
-
How to make a UI look like this image?
Hello world
I am a beginner Develop Blackberry, I am from VietNam country.
I want to design an Application interface user lookl ike this image
How to do this with Blackberry plugin for Eclipse?
Please help me? Thanks a lot
I'm waiting for the answer...
Welcome to the forums.
It's a difficult question to answer, because you are a junior developer. So, there are many things that you must learn to understand the answers you get. But could someone give you the code to do it and it might work, but if it breaks, then you know how to fix?
So instead I'll give an overview of the solution and allow you to study and learn so much more as you go.
First thing, it is to be abele to write a program that displays a screen. I guess you found samples and therefore know how to do that.
Then you need to understand the 'dimensions' and the capacity of a screen. I think this article helps with this:
http://supportforums.BlackBerry.com/T5/Java-development/MainScreen-explained/Ta-p/606644
Then you must know how to create 3 columns on your screen. I think that this article will help you with this:
Then you must know how to create a field that uses the space allocated to it al:
http://supportforums.BlackBerry.com/T5/Java-development/create-custom-fields/Ta-p/444962
Finally, you need to know how to make this a button field. To do this, you must override navigationClick and touchEvent. Enter in which is probably a little too much right now.
So many of read you.
However I really recommend to start by working through the provided tutorials - tutorial type in the search box to find these. With the help of tutorials, you will get a better understanding of how the BlackBerry "hangs together."
And finally, I recommend you get a book, such as Bill Foust.
Good luck and have fun!
-
FieldChangeListener for a GridFieldManager element
Hello
I have a GridFieldManager loaded with lots of elements in the horizontalFieldManagers type. I noticed after you add managers to GridFieldManager and appellant getFieldAtIndex to my GridFieldManager, she will return me a FIELD. Can I put a FieldChangeListener to the returned field? What I know is that I couldn't do it at HorizontalFieldManager. But I can do this returned field?
My intention is to create a list, whenever you click on one of the elements, it will change the content of the gridfieldmanager.
Thank you very much!
Yes, but BitmapFields does not normally change so don't do not normally call the change listener. You need to implement yourself for the field. It's easy, substitute navigationClick and touchEvent. There are many examples on this forum looking for an Image button.
-
NavigationClick overridden to manager does not seem to be invoked
I'm building a custom field Manager. I replaced navigationMovement and touchEvent successfully but can't do even the most basic features of working with navigationClick. I expect that this code will show at least some type of message when you click the keypad, but I have none this response:
protected boolean navigationClick(int status, int time) { Dialog.alert("Test"); System.out.println("xxxxxxxx***************XXXXXXXXXXXXXXXXX*888888888-----"); gesture="__________*******CLICK*****)______"; invalidate(); return true; }
Out of curiosity I tried to use this code with trackwheelClick instead of navigationClick and still get no response. The Manager does contain all the fields added. When I change the class to extend the field instead of the Manager, the above code works as expected (However, other parts of my code behave significantly different).
Why my manager may not be able to detect clicks?
Thank you
Scott
There are better UI people on the forum than me. But my feeling is that you will struggle to do so using a Manager because:
(a) If a manager has no field, then the amount of space on the screen he takes
(b) If a manager has no fields fiocusable, why would they focus in. And navigationClick is reflected on the current target field.
-
When I introduced the code for BlackBerryCanvas and TouchEvent at my request, I started having some error checking 2745. I suspect this is related to my application signature. If Yes, what is the ID of the required signatory, so I can add to my cso file?
Current content of CSO:
33000000 = RIMAPPSA2
52424200 = RIM Blackberry Apps API
52434300 = RIM API Crypto - Certicom
52434900 = RIM Crypto API - internal
52435200 = RIM API Crypto - RIM
52525400 = RIM API implementationThank you.
Ah. It turns out that my build script mentioned the JDE 4.5 for the CAP. Thank you.
-
Determine a diagonal move with MultitouchInputMode.GESTURE?
How can I determine a diagonal move with MultitouchInputMode.GESTURE?
Hello
You calculate that it based on the sense of the offsetX and offsetY.
Say you are listening to the TransformGestureEvent.GESTURE_SWIPE. offsetX indicates left/right-1 left and 1 right. offsetY indicate high-low with 1 for down and-1 for upward. So if it is of 1/offsetX and offsetY is 1, you went right down to the right.
It depends on what you are trying to detect. See the documentation for the TransformGestureEvent and see if any of these events gives you the values you want.
If you need more in detail that you have to roll your own "gesture" by opting for the touch events monitoring and calculation in this way.
iBrent
-
Solution to the problem of the touchEvent and click
Hi all
Finally I found the solution to touchEvent and click on the question discussed here
I put my code based on navigationClick and also said a function void touchEvent() as shown below
protected boolean navigationClick (int status, int time) {}
code click event
}
protected boolean touchEvent (TouchEvent event) {}
}
Now I can easily detect a touch event on any area on my screen
Don't know how it works, but I'm getting the desired output
Afonso Tyagi
My code works now
-
TouchEvent and fieldChange problem Listener
Hi all
I used TouchEvent and fieldChange earpiece in my application.
but the problem is that I can't activate fieldChangeListener in my application.
I capture some points on my popup screen with the button.
This workd OK
But there is a button on the pop-up screen. The associated fieldchangeListner method never gets activated!
Can someone help me?
the button get clicked only by trackball/touchpad
Thank you
Afonso Tyagi
Another option would be to call super.touchEvent and allow normal ButtonField processing to do this for you.
-
TouchEvent event and FieldChangeListener aid management
I have a class screen that extends screen and implements FieldChangeListener. I have a function that captures
TouchEvent.
protected boolean touchEvent(TouchEvent te)
I also have a function as implents FieldChangeListener
' Public Sub fieldChanged (field field, int context)
I get all the touchevents in the touchEvent function, but once I did information there, I need to go to the normal processing, is there a way to implements this? or at least goto the function fieldChanged with the right parameters (scope, context)
While when I click on an event, it goes to fieldChanged. I use picture.setChangeListener (this) to the fields I
Thank you
event management methods return true if the event has been consumed or handled and false otherwise.
If you want the event to wander in the chain must return false in your implementation of tocuhEvent (I don't know if the touch events are addressed later) -
With the help of TransformGestureEvent.GESTURE_SWIPE and TOUCH_TAP
Hello
I'm trying to create a slide in as3 for mobile with a different Touch events, but my experience does not allow me to finalize the script.
This is a slide that moves from left to right and I would like to redirect on a picture of the scenario when TOUCH_TAPE or click
Can you help me
My script
Multitouch.inputMode = MultitouchInputMode.GESTURE;
var currentGalleryItem:Number = 1;
var totalGalleryItems:Number = 4;
stage.addEventListener (TransformGestureEvent.GESTURE_SWIPE, fl_SwipeToGoToNextPreviousFrame);
function fl_SwipeToGoToNextPreviousFrame(event:TransformGestureEvent):void
{
if(Event.OffsetX == 1)
{
If (currentGalleryItem > 1) {}
-currentGalleryItem;
slideRight();
}
}
ElseIf (event.offsetX == - 1).
{
if(currentGalleryItem < totalGalleryItems) {}
currentGalleryItem ++;
slideLeft();
}
}
}
var slideCounter:Number = 0;
function slideLeft() {}
gallery_items.addEventListener ("enterFrame", moveGalleryLeft);
}
function slideRight() {}
gallery_items.addEventListener ("enterFrame", moveGalleryRight);
}
function moveGalleryLeft(evt:Event) {}
gallery_items.x = 48;
slideCounter ++;
if(slideCounter == 10) {}
gallery_items. RemoveEventListener ("enterFrame", moveGalleryLeft);
slideCounter = 0;
}
}
function moveGalleryRight(evt:Event) {}
gallery_items.x += 48;
slideCounter ++;
if(slideCounter == 10) {}
gallery_items. RemoveEventListener ("enterFrame", moveGalleryRight);
slideCounter = 0;
}
}
Stop();
Thank you
Thank you for all
I appreciate your help
Sincerlly
-
A matter of design, which is a good implementation of the following?
I have a single class that extends screen. In this class, I have a unique clock and the internal class that extends TimerTask.
public class MyScreen extends MainScreen { private Timer _t; private class MyTask extends TimerTask{ public void run() { ...impress your girlfriend with cool logic... } } }
- What is the best place to set the timer to run the timer whenever the screen is loaded?
- Constructor
- ScreenUiEngineAttachedListener
- What is the best place to cancel the timer to ensure truly cancelled once the user has closed the screen or press the physical end on the device?
- ScreenUiEngineAttachedListener
- onClose
- keyDown
- .. .or all this?
Is it advisable to use?
Thank you.
Do not start and cancel the timer - create, plan and cancel TimerTasks!
Have a static _t private timer = new Timer(); -This way, you will have just one per application (at least for this class), statically initialized. Cancel the timer just before you shut down the application. Plan all your TimerTasks on a single clock.
Your question then becomes "when can I plan and cancel my TimerTasks?" It depends on your specific needs for your TimerTasks, but the right places would be:
Annex:
Screen.onDisplay () / onUiEngineAttached (true)
Screen.onExposed () (if you go the road of onObscured() below)
Screen.keyChar () / keyDown() / keyControl() (if you go with the DeviceInfo.getIdleTime check () below)
Screen.navigationClick () (see above)
Screen.touchEvent (see above for touchscreen devices only)
To cancel:
Screen.onUndisplay () / onUiEngineAttached (false)
Screen.onObscured () (pairs with onExposed() above)
If (DeviceInfo.getIdleTime () > yourTimeoutValue inside) TimerTask.run () method - must also deal with the above-mentioned keyChar/keyDown, the navigationClick() and the touchEvent() then.
One thing to keep in mind - a TimerTask actively running will drain your battery pretty quickly by preventing your phone to enter a low power mode, so don't forget to cancel it when you don't need. On the other hand, a timer 'active' without any scheduled on that, go to sleep just forever, so don't bother killing/recreate.
- What is the best place to set the timer to run the timer whenever the screen is loaded?
Maybe you are looking for
-
Open with does not appear when I click on a URL in Firefox on my desktop
Click right 'open with' does not appear when I click on a URL in Firefox on my desktop. The codec-c no longer works with 9 update of Firefox, so I would like to open with Internet Explorer instead until the Codec-C is compatible with Firefox again.
-
My AT-100 suddenly stopped being able to see the GPS satellites. The GPS seems to turn it on. I get the cross in the notification bar, but she sees no satellite. I tried a few GPS fixing type apps but have had no joy. Any ideas, other than sending a
-
There was a problem connecting to the network
It identifies the network properly even when I put the password - and that is the password - the comment poster 'there was a problem connecting to the network. The WiFi network, you are trying to reach cannot be found. "Yet he already told me that t
-
HP 300-030na: you can add a ssd to the HP 300-030na
Hello I want to know is you can add a ssd M2 to the HP 300-030na as a second hard drive? I would like to have the essential motivation of the ssd for the speed of startup and disk of 1 TB for storage. Is - this somthink is that you can do on this mac
-
2050 J510: a HP Deskjet 2050 J510 can be ussed wireless
This printer can be used with wireless? If yes how? I installed the drivers and did the wireless Assistant but it still does not work. I'm trying to do it on a laptop. It prints when connected via USB.