# Getting Input on Bada

**URL:** <https://forums.imgtec.com/t/getting-input-on-bada/786>\
**Category:** PowerVR Insider\
**Created:** [July 31, 2010, 3:07am UTC](https://forums.imgtec.com/t/getting-input-on-bada/786 "2010-07-31T03:07:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![phred](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/phred/32/82_2.png) [@phred](https://forums.imgtec.com/u/phred)\
**Post date:** [July 31, 2010, 3:07am UTC](https://forums.imgtec.com/t/getting-input-on-bada/786/1 "2010-07-31T03:07:40Z")

</div>

Just got the SDK for the Bada and the big question is, what exactly is the best way to receive touch and accelerometer events?  
  
I see this info in the PVRShellApp class but there doesn’t seem to be a direct way from the PVRShell class (from which our app is derived from) to get access to said data.  
  
Any insight!?  
  
Fred

---

<div class="post-metadata">

**Author:** ![Scott](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/scott/32/256_2.png) [@Scott](https://forums.imgtec.com/u/Scott)\
**Post date:** [August 2, 2010, 3:41pm UTC](https://forums.imgtec.com/t/getting-input-on-bada/786/2 "2010-08-02T15:41:59Z")

</div>

Hi,

  

&nbsp;
  

You can use
  

&nbsp;
  

float \*pfTouch = (float\*) PVRShellGet(prefPointerLocation); 
  

&nbsp;
  

to get a pointer to the co-ordinates of a single touch. If&nbsp;the returned pointer&nbsp;is NULL then currently nothing is touching the screen. If you require multiple touches then you'll need to extend the PVRShell to support this.
  

&nbsp;
  

As for the accelerometer events this is&nbsp;not currently supported by the bada version of the PVRShell and may be something we add to a future release. If you would like&nbsp;to extend the Shell to support&nbsp;the accelerator&nbsp;then it seems ExamplesUIApplicationsrcSensorManagerExample.cpp from Samsung's bada SDK offers an example of how to access the relevant data using bada.
  

&nbsp;
  

Thanks,
  

&nbsp;
  

Scott

---

<div class="post-metadata">

**Author:** ![phred](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/phred/32/82_2.png) [@phred](https://forums.imgtec.com/u/phred)\
**Post date:** [August 2, 2010, 5:58pm UTC](https://forums.imgtec.com/t/getting-input-on-bada/786/3 "2010-08-02T17:58:40Z")

</div>

Hey Scott!  
  
Thanks for the reply but I ended figuring that one out after digging around. Perhaps you guys could make it much clearer as how to use the PVRShellGet functions and specifically what to type cast the returned pointers as.  
  
I figured out how to get the accelerometer to work as well.  
  
While I have you here, is it possible to re-work the whole PVRShell system with the given C++/H files or is there stuff tucked away in a lib that can’t be modified?

---

<div class="post-metadata">

**Author:** ![Scott](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/scott/32/256_2.png) [@Scott](https://forums.imgtec.com/u/Scott)\
**Post date:** [August 3, 2010, 8:18am UTC](https://forums.imgtec.com/t/getting-input-on-bada/786/4 "2010-08-03T08:18:30Z")

</div>

phred wrote:

  
While I have you here, is it possible to re-work the whole PVRShell system with the given C++/H files or is there stuff tucked away in a lib that can't be modified?  

  

&nbsp;
  

The Shell folder in the SDK contains all the source code for the PVRShell so there shouldn't by&nbsp;any problems re-working it to fit your needs.
  

&nbsp;
  

phred wrote:

Perhaps you guys could make it much clearer as how to use the PVRShellGet functions and specifically what to type cast the returned pointers as. 
  

  

  

I must admit some of the comments in the code are a little vague with regard to what is returned. We'll have a look at improving them&nbsp;for a future release.
