Reactions of: public boolean onTrackballEvent(MotionEvent event)

by cruiseru...@gmail.com » Tue, 17 Mar 2009 01:32:32 GMT


Sponsored Links
 I override onTrackBallEvent but I have problem .It has good reaction
for action move ... when I track left, it goes left, when I track
right, it goes right, but I can't stop it .When I unpress ..
(action_up) the track ball .. it does nothing... still continue to
move. It does stop moving only when I track up or down....

I have no action_up or action_cancel,down reactions ... only
action_move react.


thread.sprite.moveleft or right ... is moving my sprite untlil a call
sprite.stayStil...

Logically it should be at ACTION_UP .... but it do nothing


@Override
    public boolean onTrackballEvent(MotionEvent event) {
        switch (event.getAction()) {
        case MotionEvent.ACTION_DOWN:
                thread.sprite.stayStill();
               // trackball selected... ignore
               break;
        case MotionEvent.ACTION_UP:
                thread.sprite.stayStill();
                return true;
        case MotionEvent.ACTION_CANCEL:
               // trackball selected... ignore
                thread.sprite.stayStill();
                return true;
        case MotionEvent.ACTION_MOVE:
            if (mContext != null) {
               float x = event.getX() * event.getXPrecision();
               float y = event.getY() * event.getYPrecision();
               thread.xx=(int)x;//for debug, show on screen
               if(x<(int)0)thread.sprite.moveLeft();
               if(x>(int)0)thread.spritemoveRight();
               if(x==(int)0)thread.sprite.stayStill();
               x=0;
                return true;
            }
        }
        return super.onTrackballEvent(event);
    }

--~--~---------~--~----~------------~-------~--~----~



Reactions of: public boolean onTrackballEvent(MotionEvent event)

by cruiseru...@gmail.com » Tue, 17 Mar 2009 17:57:01 GMT


 Does have anybody experience with using trackball?
I try use trackball because DPAD emulation is not so good.

But i have no actions_up from trackball.

Thx for answers
--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. Identifying pictures taken on 'this' device

Hey,

Is there a way to identify which of the MediaStore images has been
taken
on 'this' device, as opposed to pictures exported/downloaded from an
external source ?


I have started my search by creating a Camera.PictureCallback and
registering it
by  camera.takePicture() only to realize that it only gets called upon
images taken from _my own_ application -  and idea goes to basket.

I have also looked within MediaStore.Images.Media for fields that
might carry relevant information, with no luck.

TIA,
GiladH



--~--~---------~--~----~------------~-------~--~----~

2. Recording audio stream

Is there any way to record audio stream and send streaming audio  to
network ??  Instead of recording to file.

--~--~---------~--~----~------------~-------~--~----~

3. MediaRecorder docs fix

4. Code Example

5. display image and text in listview

6. Aderirme al grupo

7. Sleep on END_CALL keycode, but terminate on HOME?