proximity

Capturing mouse events outside wx.Frame in Python

。_饼干妹妹 提交于 2019-12-10 17:32:32
问题 In Python using wxPython, how can I set the transparency and size of a window based on the proximity of the mouse relative to the application's window, or frame? Eg. similar to a hyperbolic zoom, or The Dock in MAC OS X? I am trying to achieve this effect with a png with transparency and a shaped window. Any libraries or code snippets that do this would be great too. Thanks. 回答1: Here's code to do it. Basically uses the approach mentioned by Infinity77. Tested on Windows. Works nicely! import

Detect user proximity from the screen

邮差的信 提交于 2019-12-10 13:52:38
问题 I'm working on a BB10 app that needs to be able to disable the screen when the user holds the phone up to his/her face during a call. How can I tell when the user is holding the phone up to his/her face? 回答1: To detect the user's proximity from the phone, you can use a QProximitySensor. In order to use this, you need to add these lines to your project's .pro file: CONFIG += mobility MOBILITY += sensors Add the necessary includes to the .cpp and .h files: #include <QtSensors/QProximitySensor>

How to enable proximity sensor in android

筅森魡賤 提交于 2019-12-10 11:04:22
问题 I have configured proximeter successfully in my code. Now I want to turn off & on screen programmatically. Code of sensor is working just fine and following method is also getting called. @Override public void onSensorChanged(SensorEvent event) { // TODO Auto-generated method stub PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); WakeLock screenWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,"screenWakeLock"); if (event.values[0] == 0) { screenWakeLock.acquire

Android - remove Proximity Alert after notification

孤街浪徒 提交于 2019-12-10 10:32:04
问题 what I am trying to do is have a proximity alert service which triggers a notification ONLY ONCE when you step inside the radius (without stopping the service). my code triggers notifications every time you step inside the radius and every time you step outside the radius. i've been trying with booleans and with removeProximityAlert, but no success. any ideas? import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.Service;

How to control Android proximity sensor?

六眼飞鱼酱① 提交于 2019-12-09 09:23:29
问题 Can someone provide an example as to how to use the proximity sensor? Please describe some event and how to use them. 回答1: Every android mobile is shipped with sensors to measure various environmental conditions.Proximity sensor measures the distance that some object is from the device. It is often used to detect the presence of a person’s face next to the device. Some proximity sensors only support a binary near or far measurement. In this case, the sensor should report its maximum range

Is there any way to monitor user's movement of iphone like the “raise to speak” feature?

大兔子大兔子 提交于 2019-12-09 06:35:19
问题 I want to get notified when the user raises the iphone to his face. Just like siri does. Is it possible? Add more specific requirement: I want to darken the screen when user put the phone near his ear. I know the Proximity Sensor can be enable to implement this. But it's annoying that the screen will be darkened from time to time when user moves the finger upon the sensor. So I wonder how to avoid this case and only darken the screen when user raise the iphone to speak? 回答1: See Using the

Measure distance from an iPhone to an Object using proximity sensor

一笑奈何 提交于 2019-12-08 07:09:02
问题 I have read many Forums on this topic but I still haven't found an exact answer. Is the iPhone's proximity sensor only a trigger that turns the display on or off or can one get a distance from the sensor to an object? Thank you! 回答1: The proximity sensor won't be precise enough to give you distances, it's basically a light sensor... 来源: https://stackoverflow.com/questions/4444078/measure-distance-from-an-iphone-to-an-object-using-proximity-sensor

How to change Android proximity sensor sensitivity?

故事扮演 提交于 2019-12-08 06:21:14
问题 I coded an app based on proximity sensor , but I would like to be able to give users the ability to change the sensitivity of the sensor. Is it possible? If yes how to do it? 回答1: Just "implements SensorEventListener" and follow the code : public void onCallStateChanged(int state, String incomingNumber) { switch (state) { case TelephonyManager.CALL_STATE_IDLE: System.out.println("My Call IDLE"); CallState = false; StartAudioSpeacker(); System.out.println("Is phone speaker : "+ audioManager

Measure distance from an iPhone to an Object using proximity sensor

穿精又带淫゛_ 提交于 2019-12-08 05:19:28
I have read many Forums on this topic but I still haven't found an exact answer. Is the iPhone's proximity sensor only a trigger that turns the display on or off or can one get a distance from the sensor to an object? Thank you! The proximity sensor won't be precise enough to give you distances, it's basically a light sensor... 来源: https://stackoverflow.com/questions/4444078/measure-distance-from-an-iphone-to-an-object-using-proximity-sensor

Alert when two users/friends are near to each other - Android Proximity

北城余情 提交于 2019-12-07 16:30:51
问题 I tried searching but i couldn't find anything. My Question is " How can i alert 2 or more users if they are nearby each other? " in android using Geo-fencing or something else. Say, If a UserA is in football ground and UserB walking nearby that football ground. Then UserA and UserB automatically gets notification that UserA/UserB are somewhere nearby. 回答1: Finally after spending a couple of hours thinking, I thought a better way to do this: Setup a database (MySQL,SQL etc) in your server