RemappingButtonCategory 열거형

정의

게임 패드 다시 매핑 유형입니다.

public enum class RemappingButtonCategory
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Gaming.Input.GamingInputPreviewContract, 131072)]
enum class RemappingButtonCategory
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Gaming.Input.GamingInputPreviewContract), 131072)]
public enum RemappingButtonCategory
var value = Windows.Gaming.Input.Preview.RemappingButtonCategory.buttonSettings
Public Enum RemappingButtonCategory
상속
RemappingButtonCategory
특성

Windows 요구 사항

디바이스 패밀리
Windows Desktop Extension SDK (10.0.23665.0에서 도입되었습니다.)
API contract
Windows.Gaming.Input.GamingInputPreviewContract (v2.0에서 도입되었습니다.)

필드

AnalogSettings 1

아날로그 컨트롤을 교환하는 데 사용됩니다.

ButtonSettings 0

단추를 다시 매핑하는 데 사용됩니다.

ShareDoublePress 9

구현되지 않았습니다.

ShareDoublePressMetaData 10

구현되지 않았습니다.

ShareDoublePressMetaDataDisplay 11

구현되지 않았습니다.

ShareLongPress 6

구현되지 않았습니다.

ShareLongPressMetaData 7

구현되지 않았습니다.

ShareLongPressMetaDataDisplay 8

구현되지 않았습니다.

ShareShortPress 3

구현되지 않았습니다.

ShareShortPressMetaData 4

구현되지 않았습니다.

ShareShortPressMetaDataDisplay 5

구현되지 않았습니다.

VibrationSettings 2

진동을 사용하지 않도록 설정하는 데 사용됩니다.

예제

void RemapButtons(IGameController controller, IGameControllerProvider controllerProvider)
{
    LegacyGipGameControllerProvider legacyGipGameControllerProvider =
        LegacyGipGameControllerProvider.FromGameControllerProvider(controllerProvider);

    // Retrieve all current remappings set for standard controllers
    IReadOnlyDictionary<RemappingButtonCategory, object> currentMappings =
        legacyGipGameControllerProvider.GetStandardControllerButtonRemapping(
            controller.User, false);

    // Swap two of the buttons
    Dictionary<RemappingButtonCategory, object> remaps =
        new Dictionary<RemappingButtonCategory, object>();

    // Duplicates are not allowed. Swap two of the buttons
    UInt64 currentButtonMappings =
       (UInt64)currentMappings[RemappingButtonCategory.ButtonSettings];

    // Isolate the buttons we want to remap
    UInt64 lastButton = (currentButtonMappings & 0xf000000000000000);
    UInt64 secondLastButton = currentButtonMappings & 0x0f00000000000000;

    // Swap their positions
    UInt64 newMapping = (lastButton >> 4) | (secondLastButton << 4);

    // Recombine with the original mappings
    UInt64 newButtonMappings = (currentButtonMappings & 0x00ffffffffffffff) | newMapping;

    // Add the new button remappings to the mapping dictionary
    remaps.Add(RemappingButtonCategory.ButtonSettings, newButtonMappings);

    // Update controller mapping
    legacyGipGameControllerProvider.SetStandardControllerButtonRemapping(
        controller.User, false, newButtonMappings);
}

설명

주의

컨트롤러 매핑은 시스템 전체이며 지정된 사용자에 대해 지속됩니다. 이 작업은 사용자의 지시에 따라 수행해야 합니다.

적용 대상