shake

Image shaking when StretchDIBits partially.

I am using C++ GDI, StretchDIBits to draw images on DC. Because the original Image is large, and high quality is needed. I use HAFTONE mode, to draw whole image on DC(zoom the image) seems time comsuming. So I decide to draw partially using StretchDIBits. But there is a serious problem about StretchDIBits. I can only draw rect in int...

Detecting when modal view has been displayed

This is a fun one... I have an application that has a help screen and is displayed as a modal view. The main view has an action that occurs when the device is shaken. I do not want the action to occur (sounds are played) when the help screen has been displayed. I have tried a few things... here is my code: To display the help screen...

How to use Shake API in iPhone SDK 3.0?

Apple annonced Shake API in iPhone SDK 3.0. I can not find any information regarding this new feature. Who knows about how to use it? Any example, link will be good. ...

how to detect and program around shakes for the iphone

I'm trying to implement the shake "tutorial" on this page, but I think I'm missing something. I copied his accelerometer function into myAppViewController.m file and put some nslogs in there to see if it even gets into the function when I use the simulators "shake" function. Nothing shows up in the debug console. http://mithin.in/2009...

Shake Detection iPhone 3.0 not working

I have a ViewController that works perfectly with a button that trigger an action. I would like to replace the button with a shake event so I've googled it around and created a ShakeDetector class that ineherits from UIView and my implementation is as follow: @implementation ShakeDetector - (void)motionBegan:(UIEventSubtype)motion...

iPhone Simulator always generates two shake events? (UIScrollview not scrolling for second event)

When I select "Shake Gesture" from the Hardware menu in the iPhone simulator, my first responder always receives two shake events (with a few milliseconds in between). Unfortunately these two events in the simulator lead to a problem with an UIScrollview that should scroll to a specific position - what it does, but only for the first ev...

How do I prevent a specific view from responding to shake gestures?

Hi. I use shake gesture for my application but i have problem! My application is a multiview application and i want use shake gesture on the view 2. If i active shake gesture on view 2, I have to write the code below in the MainViewController.m and MyView2Controller.m to use the shake gesture. Then if i shake the iphone, alert show on ...

[iphone] How to make objects flying around in a view

Hey, How is it possible to let some objects fly around and bumb at the end of the view and collide on each other. The second step would add acceleration of the objects by shaking. I haven't found a tutorial yet or some step to begin at. thanks a lot for your help :) Heres a picter of what i image(only a still) http://picfront.org/d...

How to detect iphone shake gesture one time !

hi i want iphone detect shake gesture only one time . after iphone had been shaken and html files showed , then i want iphone doesn't detect shake anymore . here is my code : - (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration { { if (acceleration.x > kAcceleratio...

iPhone Shake event not properly working

I have this inside my viewController: - (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event { if (event.type == UIEventSubtypeMotionShake) { NSLog(@"I have shaked"); } } Why is this not working? Edit: I do infact have this: - (void) viewWillAppear:(BOOL)animated { [shakeView becomeFirstRespond...

motionBegan and enabled breakpoints in Xcode

So ... we have this bit of motion detection: - (void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event { if (event.type == UIEventTypeMotion && event.subtype == UIEventSubtypeMotionShake) { [[NSNotificationCenter defaultCenter] postNotificationName:@"ShakeBegan" object:self]; } } Innocuous enough. We also c...

How can I detect a shake gesture in PhoneGap 0.8?

I'm using PhoneGap 0.8 and I'd like to detect a basic shake gesture. I've found two relevant snippets: http://groups.google.com/group/phonegap/browse_thread/thread/25178468b8eb9e9f http://phonegap.pbworks.com/Handling-Shake-Events Neither of them are working for me. Unfortunately the documentation seems a little outdated and the API r...

Javascript. Listen for iPhone shake event???

Hello guys, is it possible to listen for an iPhone (or any mobilephone with accelerometer) shake event with javascript? You know like shakin the iphone to shuffle the next song in itunes i want to call a js fuction on my website when the iphone got shaken. thank you for your tips and help ...

shaking on 3.0 in a UITableViewController

Hello, after reading some posts about implementing shaking on 3.0, I think I get the idea but I'm not getting any call to the: motionBegan motionEnded motionCancelled this is an example of what I've read: http://stackoverflow.com/questions/1340492/how-to-detect-and-program-around-shakes-for-the-iphone I'm sure I've added the [self b...

Android: I want to shake it!

I need to add a shake feature that will refresh my Anroid application. All I find of documentation involves implementing the SensorListener, but Eclipse tells me it's deprecated and suggest SensorEventListener. Anybody that has a nice guide to how I go about creating this "shake controller"? ...

Problem with iPhone shakes: viewDidAppear isn't called when loading viewController

I'm trying to detect a shake on the iPhone device, so for what i've read I need to set my view controller as first responder on the viewDidAppear method. This method is supposed to be called automatically, but for some reason this method is never called. Only viewDidLoad is called. this is my code (I put only the relevant parts): Build...

Can I shake a users desktop using WPF?

I'm writing an application for personal use that will track how often I reach for the mouse, and will keep a counter of how long I've gone mouseless. When I use the mouse, I would like it to shake my desktop workspace for a second as a negative reinforcement action. The application is going to be called WristSlap and will be on github a...

WinForms Application Form "Shakes" When Audio Playing

I have a C# game program that i'm developing. it uses sound samples and winsock. when i test run the game most of the audio works fine but from time to time if it is multiple samples being played sequentially the application form shakes a little bit and then goes back to its old position. how do i go about debugging this or present it ...

How to play an audio file ONLY while user is shaking iPhone?

I've read a number of posts regarding how to detect shakes but I'm not sure: What is currently the best way to detect shakes? and - How to play an audio file ONLY while the user is shaking the iPhone? Anyone have an advice, examples/tutorials or sample code? Thanks ...

Shake to open view modally

Hi, I have my 'shake' working fine (using motionEnded), based off of Apple's GLPaint code. When the user shakes the device (running 3.0 and up) I want to open a view controller modally using presentModalViewController. In my appdelegate I have the notification (as per the GLPaint sample code): [[NSNotificationCenter defaultCenter] ad...