--- title: DeviceProximityEvent slug: Web/API/DeviceProximityEvent tags: - API - Interface - Proximity Event - Reference translation_of: Web/API/DeviceProximityEvent --- <p>{{APIRef("Proximity Events")}}{{SeeCompatTable}}</p> <p><code>DeviceProximityEvent</code> インターフェースは、端末の近接センサーを使用して近くの物理オブジェクトの距離についての情報を提供します。</p> <h2 id="Properties" name="Properties">プロパティ</h2> <dl> <dt>{{domxref("DeviceProximityEvent.max")}} {{readonlyinline}}</dt> <dd>センサーが報告できる最大検出距離 (センチメートル単位)。</dd> <dt>{{domxref("DeviceProximityEvent.min")}} {{readonlyinline}}</dt> <dd>センサーが報告できる最小検出距離 (センチメートル単位)。通常は 0。</dd> <dt>{{domxref("DeviceProximityEvent.value")}} {{readonlyinline}}</dt> <dd>現在の端末近接度 (センチメートル単位)</dd> </dl> <h2 id="Examples" name="Examples">例</h2> <pre class="brush: js">window.addEventListener('deviceproximity', function(event) { console.log(<code class="brush: js">"value: " + event.value, "max: " + event.max, "min: " + event.min</code>); });</pre> <h2 id="Specifications" name="Specifications">仕様書</h2> <table class="standard-table"> <thead> <tr> <th scope="col">仕様書</th> <th scope="col">状態</th> <th scope="col">備考</th> </tr> </thead> <tbody> <tr> <td>{{ SpecName('Proximity Events', '', 'Proximity Events') }}</td> <td>{{ Spec2('Proximity Events') }}</td> <td>初回定義</td> </tr> </tbody> </table> <h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの対応</h2> <p>{{Compat("api.DeviceProximityEvent")}}</p> <h2 id="See_also" name="See_also">関連情報</h2> <ul> <li>{{event("deviceproximity")}}</li> <li>{{domxref("UserProximityEvent")}}</li> <li><a href="/ja/docs/WebAPI/Proximity" title="/ja/docs/WebAPI/Proximity">Proximity API</a></li> </ul>