> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GameInputFocusPolicy (非推奨)

> 入力デバイスのフォーカス ポリシーを列挙します (v4 で削除)。

> [!WARNING]
>
> **非推奨。** この列挙型は GameInput v4 で削除され、現在の API では利用できません。代わりに [IGameInput::EnableBackgroundInput](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinput/methods/igameinput_enablebackgroundinput.md) を使用してください。

入力デバイスのフォーカス ポリシーを列挙します。

## 構文

```cpp theme={null}
enum GameInputFocusPolicy
{
    GameInputDefaultFocusPolicy             = 0x00000000,
    GameInputExclusiveForegroundInput       = 0x00000002,
    GameInputExclusiveForegroundGuideButton = 0x00000008,
    GameInputExclusiveForegroundShareButton = 0x00000020,
    GameInputEnableBackgroundInput          = 0x00000040,
    GameInputEnableBackgroundGuideButton    = 0x00000080,
    GameInputEnableBackgroundShareButton    = 0x00000100
};
```

## 定数

| 定数 | 説明 |
| - | - |
| GameInputDefaultFocusPolicy | 入力とシステム ボタンが、プロセスにフォーカスがあるときにのみそのプロセスに送信されるようにします。 |
| GameInputExclusiveForegroundInput | GameInput を使用する他のプロセスが、このプロセスが受け取る入力を参照できないようにします。この制限はゲームにフォーカスがある場合にのみ有効で、システム ボタンには適用されません。 |
| GameInputExclusiveForegroundGuideButton | GameInput を使用する他のプロセスが、このプロセスが受け取る Guide ボタンの押下を参照できないようにします。この制限はゲームにフォーカスがある場合にのみ有効です。 |
| GameInputExclusiveForegroundShareButton | GameInput を使用する他のプロセスが、このプロセスが受け取る Share ボタンの押下を参照できないようにします。この制限はゲームにフォーカスがある場合にのみ有効です。 |
| GameInputEnableBackgroundInput | ゲームにフォーカスがない場合でも、入力が常にゲームに送信されるようにします。これにはシステム ボタンは含まれません。システム ボタンには、それぞれのフォーカス ポリシー フラグを使用する必要があります。 |
| GameInputEnableBackgroundGuideButton | フォーカスがない場合でも、Guide ボタンのイベントがゲームに送信されるようにします。ただし、フォーカスのあるプロセスが排他アクセスしている場合、Guide ボタンの押下はアプリケーションに送信されません。 |
| GameInputEnableBackgroundShareButton | フォーカスがない場合でも、Share ボタンのイベントがゲームに送信されるようにします。ただし、フォーカスのあるプロセスが排他アクセスしている場合、Share ボタンの押下はアプリケーションに送信されません。 |

## 解説

この列挙型は [IGameInput::SetFocusPolicy](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/interfaces/igameinput/methods/igameinput_setfocuspolicy.md) メソッドで使用されます。`SetFocusPolicy` を呼び出して、ゲームにフォーカスがないときに入力をゲームに送信するかどうかを指定します。既定では、GameInput はバックグラウンド入力を提供しません。値は組み合わせることができます。

ゲームが Guide ボタンまたは Share ボタンを処理する場合は、それぞれ `GameInputExclusiveForegroundGuideButton` フラグまたは `GameInputExclusiveForegroundShareButton` フラグを設定すると、バックグラウンドのオーバーレイ アプリケーションがそれらのボタンを処理しないようにするのに役立ちます。たとえば、ボタンを独自に使用するゲームの上に、不要なオーバーレイ メニューやスクリーンショットが表示されるのを防ぐことができます。

> [!NOTE]
>
> 多くのユーザーは、Guide ボタンをメニューに、Share ボタンをスクリーンショットに使用するオーバーレイ アプリケーションを使用しています。ユーザーの混乱を避けるため、ゲームでその機能をオーバーライドする必要があるかどうかを検討してください。

フォーカス ポリシーは Windows でのみ適用されます。GameInputFocusPolicy の Guide ボタンと Share ボタンの値は Windows SDK 10.0.26031 Preview の GameInput.h で追加されたもので、今後の GDK リリースで追加される予定です。

詳細については、「[GameInput の基礎](https://docs.xbox.com/ja-jp/build/core-features/common/input/overviews/input-fundamentals.md)」を参照してください。

## 要件

**ヘッダー:** GameInput.h

**サポートされているプラットフォーム:** Windows、XBOX One ファミリー本体、XBOX Series 本体

## 関連項目

[非推奨の GameInput API メンバー](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/gameinput_deprecated_members.md)\
[IGameInput::EnableBackgroundInput](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinput/methods/igameinput_enablebackgroundinput.md)\
[GameInput の概要](https://docs.xbox.com/ja-jp/build/core-features/common/input/overviews/input-overview.md)\

[GameInput](https://docs.xbox.com/ja-jp/reference/input/gameinput/gameinput_members.md)

## バージョン履歴

| バージョン | 変更内容 |
| - | - |
| **v4** | 削除されました。 |
| **v2** | `DisableBackgroundInput` (0x1) と `DisableBackgroundShareButton` (0x10) が**削除**されました。`EnableBackgroundGuideButton` (0x80) と `EnableBackgroundShareButton` (0x100) が**追加**されました。 |
| **v0** | 導入されました。 |

## 付録: 以前のバージョン

### v0

```cpp theme={null}
enum GameInputFocusPolicy
{
    GameInputDefaultFocusPolicy             = 0x00000000,
    GameInputDisableBackgroundInput         = 0x00000001,
    GameInputExclusiveForegroundInput       = 0x00000002,
    GameInputExclusiveForegroundGuideButton = 0x00000008,
    GameInputDisableBackgroundShareButton   = 0x00000010,
    GameInputExclusiveForegroundShareButton = 0x00000020,
    GameInputEnableBackgroundInput          = 0x00000040,
};
```

DisableBackgroundInput (0x1) フラグと DisableBackgroundShareButton (0x10) フラグは v2 で削除されたことに注意してください。GameInput アプリケーションは既定でバックグラウンド入力を受け取らないため、これらのフラグは冗長でした。EnableBackgroundGuideButton (0x80) フラグと EnableBackgroundShareButton (0x100) フラグは、アプリケーションがバックグラウンドで入力を受け取る意図を登録できるように v2 で追加されました。


## Related topics

- [IGameInput::SetFocusPolicy (非推奨)](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/interfaces/igameinput/methods/igameinput_setfocuspolicy.md)
- [非推奨の GameInput API メンバー](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/gameinput_deprecated_members.md)
- [IGameInput::SetFocusPolicy](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinput/methods/igameinput_setfocuspolicy.md)
- [GameInputLocation (非推奨)](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/enums/gameinputlocation.md)
- [GameInputString (非推奨)](https://docs.xbox.com/ja-jp/reference/input/gameinput/deprecated/structs/gameinputstring.md)
