Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Alternate Keymap Support #64

Closed
ZachHaber opened this issue Nov 10, 2016 · 5 comments
Closed

Alternate Keymap Support #64

ZachHaber opened this issue Nov 10, 2016 · 5 comments

Comments

@ZachHaber
Copy link

ZachHaber commented Nov 10, 2016

Hi, I'm using the Dvorak keyboard layout (still is a Qwerty keyboard, though), and I was wondering if it would be possible to add support to alternate keyboard layouts with the keybindings for those added by the mod (and by the game if possible 😄). It is always a pain for me to switch keyboard layouts for a game and then remember to switch back every time I need to type something, and it isn't possible to change keybindings for this mod without changing code probably until the persistent settings menu is finished.
I honestly have no idea how hard this would be to implement, or even if it is possible with or without the sdk for the game.

@chaorace chaorace changed the title Alternate Keyboard Bindings Alternate Keymap Support Nov 10, 2016
@chaorace
Copy link
Member

Also see discussion in #47

@LordYanaek
Copy link

Hi ZachHaber. I've looked at the code to add support for my own Azerty keyboard and already have some conditionals working (thought currently in a very rough state). Unfortunately the way i did it would require separate conditions for every keyboard so not very useful for more than 2 layouts.

I will try to see whether we can still read the game database from the Lua code as we could in Civ5 or not. If it's possible, it should be possible to create a custom table holding user-defined keybindings. Those could be defined in a simple sql file structured like an ini file. It would require rewriting all the keybindings in WorldInput.lua but everyone could, in theory, define their own keybindings if done this way.

I havn't used Lua (or any other scripting language) for quite some time thought, am not a coder and am also learning Git as i go so i'm working slowly.

@LordYanaek
Copy link

OK. I have successfully created custom tables in the database and read them from within WorldInput so it is possible to create user-configurable keybindings. I think it's something that need to be done as new hotkeys are likely to get added, we already have a lot of them, and ultimately everyone will have some hotkeys they want to change.

Here's the changes i plan to implement

  • Remove the 3 states keybindings and replace it with a simple true/false checkbox to "use additional keybindings"
  • Create a CQUI_keybinds table in the game database
  • Add a keybinds.sql file at the root of the mod folder. This file will act like an ini file for our keybinds and allow everyone to define their own keybinds. Leaving an entry empty will disable that specific keybind. There won't be a nice GUI but on the plus side those settings will be persistent between games
  • Rewrite every keybind to use the new system

@AlexandreDecan
Copy link

👍 for this feature. AWSD is clearly not easy to use on an AZERTY layout ;)

@chaorace
Copy link
Member

Absorbing this ticket into #536

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants