touch-event

trigger ontouch event programmatically

℡╲_俬逩灬. 提交于 2019-12-08 06:45:01
问题 what i'm trying to do is trigger an ontouch event at a specific region on my activity when i receive a specific string from an arduino(via bluetooth). i trying to build a controller with a wii and an arduino to use in a game i'm writing myself. before you answer this , i already know that there is a function * openButton.performClick(); for this but in the game i'm not always going to be using buttons so its not good . i want to simulate a touch like the the adb does it with monkey, but

Android: get raw bitmap data from touch events

别等时光非礼了梦想. 提交于 2019-12-08 05:15:33
问题 Is there a possibility to get an array/bitmap with the raw data of the touched spots on an Android touch display? (See illustration) So far I only know the commands event.getX(), event.getY(), event.getSize, ... 回答1: It is not possible to do this in user space. The touch input driver, part of the kernel, is responsible for taking the 'bitmap' and converting it into different points. In order to accomplish what you are trying to achieve, you need to build a new android kernel whose touch

How to make mousemove event working for touchscreen with touchmove?

て烟熏妆下的殇ゞ 提交于 2019-12-08 04:55:15
问题 I'm working on a canvas javascript where with the mousemove event you can erase the background... Now i'm trying to get the same experience for touchscreens (mobile). How can I give my code the mousemove and touchmove event at the same time? (function() { // Creates a new canvas element and appends it as a child // to the parent element, and returns the reference to // the newly created canvas element function createCanvas(parent, width, height) { var canvas = {}; canvas.node = document

Android Multi-touch event problems…No new touch events while dragging?

老子叫甜甜 提交于 2019-12-08 04:22:09
问题 So what I'm trying to make is a little space game, You control the ship with a graphic on-screen joystick using touch and drag . I have gotten this to work fine. The problem arises once I started to try and add the ability to touch the top portion of the screen to fire a weapon. For some reason, if you are currently dragging the joystick it seems to ignore the other touch input and doesn't do anything (But it works fine once I stop holding the joystick ). This is my both my first time working

How to send touch events to nextResponder in Swift

非 Y 不嫁゛ 提交于 2019-12-07 12:06:59
问题 Background I'm trying to make a UICollectionViewCell behave like a button (ie, do an animated dim on touch). I had the idea of just filling the cell with a UIButton . The button would then take care of the visual effect of being tapped. But then I would need to pass the touch event on to the parent (the UICollectionViewCell ) so that the button does not just consume the event. That way I could handle it with the collection view's didSelectItemAtPath . The problem below is my attempt to figure

Increasing touch priority of a SeekBar

拟墨画扇 提交于 2019-12-07 11:41:31
I have a SeekBar inside a HorizontalScrollView and am finding it very hard to grab the handle and move it. If I don't touch exactly on the handle, the HorizontalScrollView will receive and consume the touch event. Is there a way to increase the priority of the SeekBar so it will have the normal "range" for touch events or is this just a bad idea/design and I should avoid it? Here is an other way to fix this issue without extends a Frame layout. The idea is to disable the touch event of the HorizontalScrollView when you touch the SeekBar. So, when you initialize the view for example, you can

Android GestureDetector with SimpleOnGestureListener within SurfaceView

拟墨画扇 提交于 2019-12-07 10:54:47
问题 public class GameActivity extends Activity { private static final String TAG = "GameActivity"; . . . @Override public boolean onTouchEvent(MotionEvent event) { Log.d(TAG, "+ onTouchEvent(event:" + event + ")"); Log.d(TAG, "- onTouchEvent()"); return super.onTouchEvent(event); } . . . } public class GameView extends SurfaceView implements SurfaceHolder.Callback { private static final String TAG = "GameView"; . . . @Override public boolean onTouchEvent(MotionEvent event) { Log.d(TAG, "+

android (singletouch) drawing app undo method not working properly

夙愿已清 提交于 2019-12-07 08:02:18
问题 I am working on a drawing app but facing some undo problems. The coding is as follows: public class DoodleView extends View { Context context_new; private static final float TOUCH_TOLERANCE = 5; private Bitmap bitmap; // drawing area for display or saving private Canvas bitmapCanvas; // used to draw on bitmap private Paint paintScreen; // use to draw bitmap onto screen private Paint paintLine; // used to draw lines onto bitmap private Path mPath; private ArrayList<Path> paths = new ArrayList

Simulating touches onto an activity of another application

与世无争的帅哥 提交于 2019-12-07 04:01:24
Is it possible to simulate touch events in Android from one app to another app? Perhaps use a service or an invisible activity with SYSTEM_ALERT property to receive the input touches then simulate them to another activity of another application which is directly below the transparent activity of your application. Is this possible? [UPDATE] Taking FoamyGuy's answer into account, is it possible to have an invisible SYSTEM_ALERT activity to filter out certain touch events? I know you can revoke input for the activity. Is it possible to revoke selective input? Or do I still have to create a custom

bxSlider touch enabled - disable vertical touch events so only horizontal touch events work

梦想的初衷 提交于 2019-12-07 02:32:18
问题 I'm using probably one of my favourite jquery slider plugins: bxSlider http://bxslider.com/options#touchEnabled Recently they've updated with some touch enabling for devices. This allows you to scroll your sliders via swiping. But on my current project, I have a slideshow that takes up the entire width of my website, and when viewing on a device, as I scroll down with my finger, when I reach the the slideshow, I am unable to scroll down the page, and instead the slideshow scrolls left to