shake

iPhone Shake event not properly working

邮差的信 提交于 2019-12-11 02:52:04
问题 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 becomeFirstResponder]; [super viewWillAppear:animated]; } - (void) viewWillDisappear:(BOOL)animated { [shakeView resignFirstResponder]; [super viewWillDisappear:animated]; } 回答1: If the UIViewController is

jquery shake effect and margin-auto

谁说我不能喝 提交于 2019-12-11 02:37:53
问题 Having a spot of bother with this... shake effect example in firefox if I omit the line $this.css({'margin-left':$this.position().left}); then the box is animated over to the left instead of in the centre. If I keep that line of code to fix firefox then chrome has the same problem. Any tips on getting round this would be grand. thanks in advance 回答1: the solution (not a happy one but it 'works' cross browser - I say cross browser, got ie9 and my work machine can't run virtual PC!!!!); var

horizontal and vertical shake count using accelerometer in iPhone/iPad

北战南征 提交于 2019-12-10 09:27:09
问题 I want to count number of shake horizontally and vertically, I have referred to UIAcceleration I have also referred to Motion Events But couldn't come up with better approach. Any kind of help is highly appreciated , code , reference, or any type. i just want to count the number of shake user make by shaking the iphone device, the shake can be vertically or horizontally holding iphone in normal way(home key at the bottom) 回答1: Try DiceShaker. You'll need to use the code for "Isolating

Javascript. Listen for iPhone shake event?

☆樱花仙子☆ 提交于 2019-12-10 02:50:24
问题 Is it possible to listen for an iPhone (or any mobile phone with accelerometer) shake event with JavaScript? You know like shaking the iPhone to shuffle the next song in iTunes I want to call a JS function on my website when the iPhone got shaken. 回答1: Not as a straight web app, no. If you wrap your web app in PhoneGap, it exposes accelerometer and other app-only features to the site running within it, but the downside is that people have to actually download your app - they can't just browse

How to achieve vigorous Shake in iOS?

两盒软妹~` 提交于 2019-12-08 07:29:28
问题 I am using Shake Feature in ios. Its working fine with the below code. But when i go for vigorous shake, it detected the shaking and with in a second it calls this line if (histeresisExcited && !L0AccelerationIsShaking(self.lastAcceleration, acceleration, 0.2)) { histeresisExcited = NO;} though i keep on shaking. How to achieve vigorous shaking? What i am doing wrong here? // Ensures the shake is strong enough on at least two axes before declaring it a shake. // "Strong enough" means "greater

How to detect that the phone (WP7) has stopped shaking

爱⌒轻易说出口 提交于 2019-12-08 06:41:33
I can get the phone to react to a shake, but what is the best way to tell that it has stopped shaking? This example worked for me. At the very bottom of the page you'll see: if (!_shaking && CheckForShake(_lastReading, reading, ShakeThreshold) && _shakeCount >= 1) { //We are shaking _shaking = true; _shakeCount = 0; OnShakeDetected(); } else if (CheckForShake(_lastReading, reading, ShakeThreshold)) { _shakeCount++; } else if (!CheckForShake(_lastReading, reading, 0.2)) { _shakeCount = 0; _shaking = false; } Do like #Daniel Pereira said, but in the void ShakeDetected(object sender, EventArgs e)

Programmatically trigger shake event iOS

妖精的绣舞 提交于 2019-12-07 12:25:16
问题 How can I programmatically trigger the shake event in iOS? I've tried the following but it keeps crashing... + (void)shake { NSLog(@"TEST"); UIMotionEventProxy *m = [[NSClassFromString(@"UIMotionEvent") alloc] _init]; m->_subtype = UIEventSubtypeMotionShake; m->_shakeState = 1; [[[UIApplication sharedApplication] keyWindow] motionBegan:UIEventSubtypeMotionShake withEvent:m]; [[[UIApplication sharedApplication] keyWindow] motionEnded:UIEventSubtypeMotionShake withEvent:m]; } What does apple do

Programmatically trigger shake event iOS

回眸只為那壹抹淺笑 提交于 2019-12-06 00:11:46
How can I programmatically trigger the shake event in iOS? I've tried the following but it keeps crashing... + (void)shake { NSLog(@"TEST"); UIMotionEventProxy *m = [[NSClassFromString(@"UIMotionEvent") alloc] _init]; m->_subtype = UIEventSubtypeMotionShake; m->_shakeState = 1; [[[UIApplication sharedApplication] keyWindow] motionBegan:UIEventSubtypeMotionShake withEvent:m]; [[[UIApplication sharedApplication] keyWindow] motionEnded:UIEventSubtypeMotionShake withEvent:m]; } What does apple do in the simulator under Hardware > Shake Gesture ? Changing the UIMotionEventProxy class (adding two

Orba is an controller with gesture control and haptic feedback

孤街醉人 提交于 2019-12-05 23:31:08
Nashville-based tech company Artiphon has a new music-making gadget up for backing on Kickstarter called Orba. The Orba is a small, handheld device that’s a synth, looper, and controller all in one. It’s shaped like a halved grapefruit, and mimics the gestures used on smartphones and trackpads to let you make beats and play around with sounds with a variety of motions. The flat top of the Orba is divided into eight segments that let you stack drum, bass, chord, and lead layers, and operate basic controls like record and pause. Then, the center acts as a menu button for cycling between features

horizontal and vertical shake count using accelerometer in iPhone/iPad

杀马特。学长 韩版系。学妹 提交于 2019-12-05 15:39:02
I want to count number of shake horizontally and vertically, I have referred to UIAcceleration I have also referred to Motion Events But couldn't come up with better approach. Any kind of help is highly appreciated , code , reference, or any type. i just want to count the number of shake user make by shaking the iphone device, the shake can be vertically or horizontally holding iphone in normal way(home key at the bottom) Try DiceShaker . You'll need to use the code for "Isolating Instantaneous Motion from Acceleration Data" given in Listing 4-6 of the motion events (also called high-pass