Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steam Deck fix #982

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions bin/input-remapper-control
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import logging
import os
import subprocess
import sys
from enum import Enum
from enum import Enum, EnumMeta
from typing import Union, Optional

from inputremapper.configs.global_config import GlobalConfig
Expand All @@ -41,15 +41,24 @@ from inputremapper.logging.logger import logger
# log level is applied before anything is logged


class Commands(Enum):
class MetaEnum(EnumMeta):
def __contains__(cls, item):
try:
cls(item)
except ValueError:
return False
return True


class Commands(Enum, metaclass=MetaEnum):
AUTOLOAD = "autoload"
START = "start"
STOP = "stop"
STOP_ALL = "stop-all"
HELLO = "hello"


class Internals(Enum):
class Internals(Enum, metaclass=MetaEnum):
# internal stuff that the gui uses
START_DAEMON = "start-daemon"
START_READER_SERVICE = "start-reader-service"
Expand Down