Reactions of: public boolean onTrackballEvent(MotionEvent event)

by » 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

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

    public boolean onTrackballEvent(MotionEvent event) {
        switch (event.getAction()) {
        case MotionEvent.ACTION_DOWN:
               // trackball selected... ignore
        case MotionEvent.ACTION_UP:
                return true;
        case MotionEvent.ACTION_CANCEL:
               // trackball selected... ignore
                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
                return true;
        return super.onTrackballEvent(event);


Reactions of: public boolean onTrackballEvent(MotionEvent event)

by » 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. Custom preference

I need to create a preference that looks similiar like the WiFi
selection screen in the OS preferences.  That screen has a ListView
that takes up the whole bottom of the screen.  I have figured out how
to add a ListView using a custom preference but I can't make it take
up the remaining space.  It is always just the size of a single
preference row.

protected View onCreateView(ViewGroup parent){

        LinearLayout layout = new LinearLayout(getContext());

        LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(


        list = new ListView(getContext());


        adapter = new ArrayAdapter<String>(getContext(),
android.R.layout.simple_list_item_1, new String[]{"abc", "def"});

        return layout;


2. Porting gingerbread on 2.6.31

what is difference between kernel 2.6.31 and 2.6.36.
can Gingerbread be ported on 2.6.31 kernel version.


3. input event in gingerbread

4. NFC Smart poster and Tag reader

5. OOT: Paging Om Tony Piter

6. UAC based on sip

7. Problems with getting signal strength