Re: Wheret o store my commands?
Maybe have a class which contains the default hotkey? Then there's the possibility the user can change them later on.If you're talking about using hard coded numbers then I'd avoid it. Hopefully whatever library you're using provides something like
Re: Wheret o store my commands?
Yeah, the file contains command IDs and hotkeys, but should I just hardcode these IDs?
URL: https://forum.audiogames.net/post/599209/#p599209
--
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin
Re: Wheret o store my commands?
Personally, I'd have the keys file, which would contain the dictionary. Then I'd import all commands, and assign their hotkeys in that file:from .commands.general import quit, load, save
keys: Dict[str, commandFunc] = {
'q': quit,
'f3': load
Wheret o store my commands?
I am creating an application revolving heavily arround the command design pattern, since I want to make it possible for the user to assign keyboard hoteksy to everything possible.I have the command pattern implemented, with receiver, invoker and the like as well