__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-volume-buttons

Getting Started

GitHub

CapgoのAIアシストセットアップを使用してプラグインをインストールできます。次のコマンドを使用して、CapgoスキルをAIツールに追加します。

ターミナルウィンドウ
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

次のプロンプトを使用してください:

Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-volume-buttons` plugin in my project.

Manual Setupを使用する場合は、次のコマンドを実行して、以下のプラットフォーム固有の指示に従ってください。

ターミナルウィンドウ
bun add @capgo/capacitor-volume-buttons
bunx cap sync
import { VolumeButtons } from '@capgo/capacitor-volume-buttons';

ハードウェアボリュームボタンの押下を検知する。

import { VolumeButtons } from '@capgo/capacitor-volume-buttons';
const listener = await VolumeButtons.addListener(
'volumeButtonPressed',
(event) => {
console.log(`Volume ${event.direction} button pressed`);
}
);
// Remove listener when done
await listener.remove();

このプラグインのすべてのリスナーを削除します。

import { VolumeButtons } from '@capgo/capacitor-volume-buttons';
await VolumeButtons.removeAllListeners();

ネイティブのCapacitorプラグインのバージョンを取得します。

import { VolumeButtons } from '@capgo/capacitor-volume-buttons';
const { version } = await VolumeButtons.getPluginVersion();
console.log('Plugin version:', version);

ボリュームボタンイベントのリスナー関数。

export type VolumeButtonListener = (event: VolumeButtonPressed) => void;

ボリュームボタン押下イベントのデータ。

export interface VolumeButtonPressed {
/** Direction of the button press */
direction: VolumeButtonDirection;
}

VolumeButtonDirection

ボリュームボタン方向

ボリュームボタン押下の方向。

export type VolumeButtonDirection = 'up' | 'down';

真実の源

真実の源

このページはプラグインのソースコードから生成されています。 src/definitions.ts. APIを再度同期するには、上流でAPIが変更されたときに再度同期してください。

Getting Startedから続けてください。

Getting Startedから続けてください。

あなたが「Getting Started」を使用してダッシュボードと__CAPGO_KEEP_0__の操作を計画している場合、__CAPGO_KEEP_0__を__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-volume-buttonsと接続してください。 Getting Started Using @API/__CAPGO_KEEP_1__-volume-buttons Using @capgo/capacitor-volume-buttons for the native capability in Using @capgo/capacitor-volume-buttons, API Overview for the implementation detail in API Overview, Introduction __CAPGO_KEEP_0__ API キー 実装詳細の API キーについて デバイス 実装詳細のデバイスについて