Skip to content

Conversation

@sezanzeb
Copy link
Owner

@sezanzeb sezanzeb commented Feb 25, 2025

  • Allow grouping multiple devices together, to make presets that apply to multiple devices at once. However, I won't make a user interface for this feature, too much work.
  • There is also a feature to group all devices together into one. I did change the gui for this at least, but it isn't ideal.
  • Dependency injection for groups
  • document configuration.
  • BaseConfig is only used for GlobalConfig. Architecture can be simplified. Possibly use a pydantic model just like with presets.
  • Split group classes into folder
  • Icon for "All Devices"
  • Tests
  • Or use a button for "Map all devices" which writes the config, and brings you to the "Presets" section. That would mean it would have to reset back to individual-devices when going to the "Devices" section. Maybe call it "Global Preset" or something.
  • What happens with autoloading when both individual presets and the all-devices preset is set to autoload?
  • Or an entry in the first tab that says "All of them" alongside the individual devices. Clicking this writes the config and switches to the presets tab for the "All Devices" group.

Help

Please install this if you know how (check the readme out at the bottom, uninstall input-remapper first) and see if anything bad happens. Provide feedback if something breaks.

from evdev.ecodes import EV_ABS, EV_KEY

from inputremapper.groups import groups, _Groups
from inputremapper.groups import groups, Groups

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[mypy] reported by reviewdog 🐶
error: Module "inputremapper.groups" has no attribute "groups"; maybe "Groups"? [attr-defined]

def setUp(self) -> None:
self.message_broker = MessageBroker()
self.reader = ReaderClient(self.message_broker, _Groups())
self.reader = ReaderClient(self.message_broker, Groups())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[mypy] reported by reviewdog 🐶
error: Missing positional argument "global_config" in call to "Groups" [call-arg]

self.message_broker,
GlobalConfig(),
ReaderClient(self.message_broker, _Groups()),
ReaderClient(self.message_broker, Groups()),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[mypy] reported by reviewdog 🐶
error: Missing positional argument "global_config" in call to "Groups" [call-arg]

else:
result = self._group_all_into_one()

self.pipe.send(json.dumps([group.dumps() for group in result]))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[mypy] reported by reviewdog 🐶
error: multiprocessing.Pipe? has no attribute "send" [attr-defined]


used_names.add(unique_name)

group = Group(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[mypy] reported by reviewdog 🐶
error: Incompatible types in assignment (expression has type "Group", variable has type "list[tuple[str, str, DeviceType]]") [assignment]


group = Group(
key=unique_name,
paths=devs,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[mypy] reported by reviewdog 🐶
error: Argument "paths" to "Group" has incompatible type "list[str]"; expected "list[PathLike[Any]]" [arg-type]

capabilities = device.capabilities(absinfo=False)
result.append(group)

return result

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[mypy] reported by reviewdog 🐶
error: Incompatible return value type (got "list[list[tuple[str, str, DeviceType]]]", expected "list[Group]") [return-value]

self._groups: List[_Group] = None
def __init__(self, global_config: GlobalConfig):
self.global_config = global_config
self._groups: List[Group] = None

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[mypy] reported by reviewdog 🐶
error: Incompatible types in assignment (expression has type "None", variable has type "list[Group]") [assignment]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants