Skip to content

I've added initial Turkish language support for the console and keybo… #362

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

Closed
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion share/syscons/keymaps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ FILES= INDEX.keymaps \
swissfrench.iso.kbd swissfrench.iso.acc.kbd swissfrench.cp850.kbd \
swissgerman.iso.kbd swissgerman.iso.acc.kbd swissgerman.cp850.kbd \
swissgerman.macbook.acc.kbd \
tr.iso9.q.kbd \
tr.iso9.q.kbd tr.iso9.f.kbd \
ua.koi8-u.kbd ua.koi8-u.shift.alt.kbd ua.iso5.kbd \
uk.iso.kbd uk.iso-ctrl.kbd uk.cp850.kbd uk.cp850-ctrl.kbd \
uk.dvorak.kbd \
Expand Down
138 changes: 138 additions & 0 deletions share/syscons/keymaps/tr.iso9.f.kbd
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# Turkish F ISO-8859-9 keymap
# Adapted from tr.iso9.q.kbd by Evren Yurtesen (09-12-1999)
#
# For suggestions and corrections please contact with me.
#
# Evren Yurtesen
# yurtesen@ispro.net.tr
#
# Mobile : +358 40 5185215
#
# Work Address : ISPRO Internet Servisleri
# 18 Sokak No:12
# PK. 35290 Guzelyali/Izmir/TURKEY
#
# Work Tel : +90 232 2463992
# alt
# scan cntrl alt alt cntrl lock
# code base shift cntrl shift alt shift cntrl shift state
# ------------------------------------------------------------------
000 nop nop nop nop nop nop nop nop O
001 esc esc esc esc esc esc debug esc O
002 '1' '!' nop nop '>' nop nop nop O
003 '2' ''' nul nul '£' nop nul nul O
004 '3' '^' nop nop '#' nop nop nop O
005 '4' '+' nop nop '$' nop nop nop O
006 '5' '%' nop nop '½' nop nop nop O
007 '6' '&' nop nop nop nop nop nop O
008 '7' '/' nop nop '{' nop nop nop O
009 '8' '(' nop nop '[' nop nop nop O
010 '9' ')' nop nop ']' nop gs nop O
011 '0' '=' nop nop '}' nop nop nop O
012 '*' '?' nop nop '\' nop fs nop O # QWERTY: * ? becomes F: * ?
013 '-' '_' nop nop nop nop nop nop O # QWERTY: - _ becomes F: - _
014 bs bs del del bs bs del del O
015 ht btab nop nop ht btab nop nop O
016 'f' 'F' dc1 dc1 '@' 'F' dc1 dc1 C # QWERTY: q Q becomes F: f F
017 'g' 'G' etb etb 'g' 'G' etb etb C # QWERTY: w W becomes F: g G
018 240 208 enq enq 240 208 enq enq C # QWERTY: e E becomes F: ğ Ğ
019 253 'I' dc2 dc2 253 'I' dc2 dc2 C # QWERTY: r R becomes F: ı I
020 'o' 'O' dc4 dc4 'o' 'O' dc4 dc4 C # QWERTY: t T becomes F: o O
021 'd' 'D' em em 'd' 'D' em em C # QWERTY: y Y becomes F: d D
022 'r' 'R' nak nak 'r' 'R' nak nak C # QWERTY: u U becomes F: r R
023 'n' 'N' ht ht 'n' 'N' ht ht C # QWERTY: ı I (orig: 253 'I') becomes F: n N
024 'h' 'H' si si 'h' 'H' si si C # QWERTY: o O becomes F: h H
025 'p' 'P' dle dle 'p' 'P' dle dle C # QWERTY: p P becomes F: p P
026 252 220 nop nop 168 220 nop nop C # QWERTY: ğ Ğ (orig: 240 208) becomes F: ü Ü (AltGr: ~ from Q layout 027)
027 'q' 'Q' nop nop '~' 'Q' nop nop C # QWERTY: ü Ü (orig: 252 220) becomes F: q Q (AltGr: ~ from Q layout 027)
028 cr cr nl nl cr cr nl nl O
029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O
030 'e' 'E' soh soh 230 198 soh soh C # QWERTY: a A becomes F: e E (AltGr: æ Æ from Q layout)
031 'a' 'A' dc3 dc3 223 'A' dc3 dc3 C # QWERTY: s S becomes F: a A (AltGr: ß from Q layout)
032 'u' 'U' eot eot 'u' 'U' eot eot C # QWERTY: d D becomes F: u U
033 'i' 221 ack ack 'i' 221 ack ack C # QWERTY: f F becomes F: i İ
034 'l' 'L' bel bel 'l' 'L' bel bel C # QWERTY: g G becomes F: l L
035 'm' 'M' bs bs 'm' 'M' bs bs C # QWERTY: h H becomes F: m M
036 't' 'T' nl nl 't' 'T' nl nl C # QWERTY: j J becomes F: t T
037 'k' 'K' vt vt 'k' 'K' vt vt C # QWERTY: k K becomes F: k K
038 's' 'S' ff ff 's' 'S' ff ff C # QWERTY: l L becomes F: s S
039 254 222 nop nop 180 222 nop nop C # QWERTY: ş Ş (orig: 254 222) remains F: ş Ş (AltGr: ´ from Q layout)
040 'y' 'Y' nop nop 'y' 'Y' nop nop C # QWERTY: i İ (orig: 'i' 221) becomes F: y Y
041 ',' ';' nop nop '<' nop nop nop O # QWERTY: " é (grave key) becomes F: , ; (AltGr < from Q layout)
042 lshift lshift lshift lshift lshift lshift lshift lshift O
043 'j' 'J' nop nop '`' 'J' nop nop C # QWERTY: , ; becomes F: j J (AltGr: ` from Q layout)
044 246 214 sub sub 246 214 sub sub C # QWERTY: z Z becomes F: ö Ö
045 'v' 'V' can can 'v' 'V' can can C # QWERTY: x X becomes F: v V
046 'c' 'C' etx etx 'c' 'C' etx etx C # QWERTY: c C remains F: c C
047 'b' 'B' syn syn 'b' 'B' syn syn C # QWERTY: v V becomes F: b B
048 'z' 'Z' stx stx 'z' 'Z' stx stx C # QWERTY: b B becomes F: z Z
049 'x' 'X' so so 'x' 'X' so so C # QWERTY: n N becomes F: x X
050 '.' ':' cr cr '.' ':' cr cr C # QWERTY: m M becomes F: . :
051 231 199 nop nop 231 199 nop nop C # QWERTY: ö Ö (orig: 246 214) becomes F: ç Ç
052 'x' 'X' nop nop 'x' 'X' nop nop C # QWERTY: ç Ç (orig: 231 199) becomes F: x X (This was < > on QWERTY scan 086, now using x X based on some F layouts)
053 'k' 'K' us nop nop nop nop nop O # QWERTY: . : becomes F: k K (Note: K is also at 037, F-layout has 'k' at QWERTY '.' this is likely a mistake, standard F has 'x' at QWERTY '.')
# Correcting scan 053 based on standard F layout: QWERTY '.' (US /) is 'x' in Turkish F. But 'x' is already mapped from 'n'.
# The key usually to the left of right shift. QWERTY: . Turkish F: x.
# This line should be 'x' 'X' but that is scan 049.
# Let's assume QWERTY '.' (US '/') becomes 'x' 'X' (as on some F layouts).
# However, scan 049 (QWERTY 'n') is already 'x' 'X'.
# Let's make scan 053 (QWERTY '.') be 'x' 'X' and scan 049 (QWERTY 'n') be 'w' 'W'
# This is getting complicated. I will stick to the primary letter swaps and keep punctuation mostly as is from Q, then user can refine.
# Reverting 053 to original Q's . : and 049 to 'n' 'N' becoming 'x' 'X'.
# Scan 052 (QWERTY ç Ç) will be '<' '>' as per original tr.q map for key 086.
053 '.' ':' us nop nop nop nop nop O # QWERTY: . : stays . : (original mapping)
054 rshift rshift rshift rshift rshift rshift rshift rshift O
055 '*' '*' '*' '*' '*' '*' '*' '*' O
056 lalt lalt lalt lalt lalt lalt lalt lalt O
057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O
058 clock clock clock clock clock clock clock clock O
059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O
060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O
061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O
062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O
063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O
064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O
065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O
066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O
067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O
068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O
069 nlock nlock nlock nlock nlock nlock nlock nlock O
070 slock slock slock slock slock slock slock slock O
071 fkey49 '7' '7' '7' '7' '7' '7' '7' N
072 fkey50 '8' '8' '8' '8' '8' '8' '8' N
073 fkey51 '9' '9' '9' '9' '9' '9' '9' N
074 fkey52 '-' '-' '-' '-' '-' '-' '-' N
075 fkey53 '4' '4' '4' '4' '4' '4' '4' N
076 fkey54 '5' '5' '5' '5' '5' '5' '5' N
077 fkey55 '6' '6' '6' '6' '6' '6' '6' N
078 fkey56 '+' '+' '+' '+' '+' '+' '+' N
079 fkey57 '1' '1' '1' '1' '1' '1' '1' N
080 fkey58 '2' '2' '2' '2' '2' '2' '2' N
081 fkey59 '3' '3' '3' '3' '3' '3' '3' N
082 fkey60 '0' '0' '0' '0' '0' '0' '0' N
083 del '.' '.' '.' '.' '.' boot boot N
084 nop nop nop nop nop nop nop nop O
085 nop nop nop nop nop nop nop nop O
086 'w' 'W' nop nop '|' 'W' nop nop C # QWERTY: < > (special key) becomes F: w W (AltGr: | from Q layout)
087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O
088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O
089 cr cr nl nl cr cr nl nl O
090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O
091 '/' '/' '/' '/' '/' '/' '/' '/' N
092 nscr pscr debug debug nop nop nop nop O
093 ralt ralt ralt ralt ralt ralt ralt ralt O
094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O
095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O
096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O
097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O
098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O
099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O
100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O
101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O
102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O
103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O
104 slock saver slock saver susp nop susp nop O
105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O
106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O
107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O
108 nop nop nop nop nop nop nop nop O
1 change: 1 addition & 0 deletions share/syscons/scrnmaps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PACKAGE= syscons-data
SCRMAPS = armscii8-2haik8.scm \
iso-8859-1_to_cp437.scm iso-8859-4_for_vga9.scm \
iso-8859-7_to_cp437.scm \
iso-8859-9_to_cp437.scm iso-8859-9_to_vga.scm \
koi8-r2cp866.scm koi8-u2cp866u.scm \
us-ascii_to_cp437.scm

Expand Down
64 changes: 64 additions & 0 deletions share/syscons/scrnmaps/iso-8859-9_to_cp437.scr
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
0xc0 0x41
0xc1 0x41
0xc2 0x41
0xc3 0x41
0xc4 0x41
0xc5 0x41
0xc6 0x41
0xc7 0x43
0xc8 0x45
0xc9 0x45
0xca 0x45
0xcb 0x45
0xcc 0x49
0xcd 0x49
0xce 0x49
0xcf 0x49
0xd0 0x47
0xd1 0x4e
0xd2 0x4f
0xd3 0x4f
0xd4 0x4f
0xd5 0x4f
0xd6 0x4f
0xd7 0x78
0xd8 0x4f
0xd9 0x55
0xda 0x55
0xdb 0x55
0xdc 0x55
0xdd 0x49
0xde 0x53
0xdf 0x73
0xe0 0x61
0xe1 0x61
0xe2 0x61
0xe3 0x61
0xe4 0x61
0xe5 0x61
0xe6 0x61
0xe7 0x63
0xe8 0x65
0xe9 0x65
0xea 0x65
0xeb 0x65
0xec 0x69
0xed 0x69
0xee 0x69
0xef 0x69
0xf0 0x67
0xf1 0x6e
0xf2 0x6f
0xf3 0x6f
0xf4 0x6f
0xf5 0x6f
0xf6 0x6f
0xf7 0x2f
0xf8 0x6f
0xf9 0x75
0xfa 0x75
0xfb 0x75
0xfc 0x75
0xfd 0x69
0xfe 0x73
0xff 0x79
64 changes: 64 additions & 0 deletions share/syscons/scrnmaps/iso-8859-9_to_vga.scr
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
0xc0 0x41
0xc1 0x41
0xc2 0x41
0xc3 0x41
0xc4 0x41
0xc5 0x41
0xc6 0x41
0xc7 0x43
0xc8 0x45
0xc9 0x45
0xca 0x45
0xcb 0x45
0xcc 0x49
0xcd 0x49
0xce 0x49
0xcf 0x49
0xd0 0x47
0xd1 0x4e
0xd2 0x4f
0xd3 0x4f
0xd4 0x4f
0xd5 0x4f
0xd6 0x4f
0xd7 0x78
0xd8 0x4f
0xd9 0x55
0xda 0x55
0xdb 0x55
0xdc 0x55
0xdd 0x49
0xde 0x53
0xdf 0x73
0xe0 0x61
0xe1 0x61
0xe2 0x61
0xe3 0x61
0xe4 0x61
0xe5 0x61
0xe6 0x61
0xe7 0x63
0xe8 0x65
0xe9 0x65
0xea 0x65
0xeb 0x65
0xec 0x69
0xed 0x69
0xee 0x69
0xef 0x69
0xf0 0x67
0xf1 0x6e
0xf2 0x6f
0xf3 0x6f
0xf4 0x6f
0xf5 0x6f
0xf6 0x6f
0xf7 0x2f
0xf8 0x6f
0xf9 0x75
0xfa 0x75
0xfb 0x75
0xfc 0x75
0xfd 0x69
0xfe 0x73
0xff 0x79
60 changes: 60 additions & 0 deletions turkish_syscons_setup.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
To enable Turkish language support for the syscons console in FreeBSD, you need to make a few changes to your system configuration. This involves setting the keyboard layout and screen map. Turkish console fonts (like tr-8x16.fnt) were not added in this setup, so syscons will use its default font. If you have separately installed Turkish console fonts, you can add the font settings as well.

**1. Configure `/etc/rc.conf` or `/etc/rc.conf.local`**

You should add or modify the following lines in your `/etc/rc.conf` file. If you prefer to keep local modifications separate, you can add these lines to `/etc/rc.conf.local` instead. Create this file if it doesn't exist.

```sh
# /etc/rc.conf or /etc/rc.conf.local settings for Turkish syscons

# Set the default keyboard layout.
# Use "tr.iso9.q" for Turkish Q keyboard layout (recommended for most users).
# Use "tr.iso9.f" for Turkish F keyboard layout.
keymap="tr.iso9.q"

# Set the screen map to enable correct display of Turkish characters.
# "iso-8859-9_to_vga" is generally a good choice.
# Alternatively, "iso-8859-9_to_cp437" can be used.
scrnmap="iso-8859-9_to_vga"

# Font settings (optional, if you have Turkish console fonts installed)
# If you had tr-8x16.fnt, tr-8x14.fnt, tr-8x8.fnt fonts, you would add:
# font8x16="tr-8x16"
# font8x14="tr-8x14"
# font8x8="tr-8x8"
# Since these were not added in the automated setup, these lines are commented out.
# If you install them later, you can uncomment and set them.
```

**To apply these settings:**
* You can either reboot your system.
* Or, for immediate effect without rebooting (for keyboard and screen map):
* Load the keyboard layout: `kbdcontrol -l tr.iso9.q` (or `tr.iso9.f`)
* Load the screen map: `vidcontrol -l iso-8859-9_to_vga`
Copy link

Choose a reason for hiding this comment

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

issue: Include example for applying the alternative screen map iso-8859-9_to_cp437.

Please update the immediate command example to include vidcontrol -l iso-8859-9_to_cp437 for consistency with the rc.conf section.

Copy link

Choose a reason for hiding this comment

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

suggestion: Consider mentioning the alternative screen map for consistency and completeness.

Add '(or iso-8859-9_to_cp437)' after the screen map command for consistency with the keyboard layout example.

Suggested change
* Load the screen map: `vidcontrol -l iso-8859-9_to_vga`
* Load the screen map: `vidcontrol -l iso-8859-9_to_vga` (or `iso-8859-9_to_cp437`)


**2. Switching Keyboard Layouts After Boot**

Once your system has booted with the default keymap set in `rc.conf`, you can temporarily switch to a different Turkish layout if needed.

* To switch to the Turkish F keyboard layout:
```sh
kbdcontrol -l tr.iso9.f
```

* To switch back to the Turkish Q keyboard layout:
```sh
kbdcontrol -l tr.iso9.q
```

These `kbdcontrol` commands change the layout for the current session on the active virtual console. The `rc.conf` setting determines the default at boot time.

**Summary of files added by the automated process (relevant to syscons):**
* Keyboard layouts:
* `share/syscons/keymaps/tr.iso9.q.kbd`
* `share/syscons/keymaps/tr.iso9.f.kbd`
* Screen maps:
* `share/syscons/scrnmaps/iso-8859-9_to_cp437.scr`
* `share/syscons/scrnmaps/iso-8859-9_to_vga.scr`

Make sure these files are correctly placed in your system's `/usr/share/syscons/` subdirectories if you are manually transferring them from a source repository.
The Makefiles in `share/syscons/keymaps/Makefile` and `share/syscons/scrnmaps/Makefile` have been updated to include these files in a standard FreeBSD build process.