-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial changes to support non-american keyboard layouts & cyrillic c…
…haracters. Uses SDL2 TextInput event, unfortunately the unicode character is sent after the keydown event, so we need to know if the keydown event is going to produce a character or not... currently the system lets the keydown event produce that character, but then backspaces and replaces it with the unicode version, which seems ugly. The console still translates and stores in wchar at the moment, so true utf8 printing isn't possible, we only support up to 3-byte utf8 characters. Can now also choose the encoding method on outgoing messages: cl_textencoding Controls method to encode outgoing extended characters (> 255) 0 - koi8 encoding (wrapped with =`k8:<text>`=) 1 - utf8 encoding (wrapped with =`utf8:<text>`=) 2 - FTE encoding (convert to ^Uxxxx where xxxx is hex) 0 can encode limited set of characters, but compatible with 2.2 clients 1 encodes all characters correctly for all but only other 3.0 clients 2 compatible with FTE & 3.0 Regardless of this setting, the client will continue to decode svc_print messages using all of the above incoming methods. Previously only -cyr suffix was supported for extended character sets. Now all are supported, from -001 to -256. If -004 isn't present it will fall back to loading -cyr. This is a lot of textures to load and we might need to look at methods to reduce the number. To support compatibility with existing configuration files (and passing config files between machines with different keyboard layouts), the bind and unbind commands look up the key based on the keyboard layout only when con_bindphysical is set to 0. All configuration files will start with con_bindphysical set to 1, and it is reset back to its previous value once the configuration file has completed. If configuration files want to bind to a key based on layout (a demo-watching configuration where the user should press R to toggle radar for example) then the configuration file should set con_bindphysical to 0 before binding any keys. Hopefully this is a solution to non-american keyboards that is natural to use in the console and is backwards-compatible with existing configs.
- Loading branch information
Showing
11 changed files
with
392 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.