Adding Wijesekara Sinhala keyboard

Forum Forums General Software Adding Wijesekara Sinhala keyboard

  • This topic has 12 replies, 4 voices, and was last updated Mar 28-10:51 am by parippu.
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #79662
    Member
    parippu

      I’m using antiX 21 with IceWM on a computer with a Spanish keyboard. I want to be able to type Sinhala characters and I don’t want to use a phonetic transcription input method. I’ve installed Ibus and M17n and used them to add a Wijesekara Sinhala keyboard layout, which is the standard layout for Sinhala in Sri Lanka. In LibreOffice I can now type nearly all the basic Sinhala characters, but there are some problems, probably caused by the fact that I’m using a Spanish keyboard.
      – Two characters are missing: U+0DA4 taaluja naasikyaya and U+0DA5 taaluja sanyooga naasikyaya. They probably correspond to the grave accent key, which is in the position occupied by the left square bracket key on a US keyboard. If I select the Wijesekara layout, pressing the grave accent key, with or without shift, produces no character on screen and seems to have no effect.
      – I can’t find keys corresponding to zero width join and zero width non-join. I’ve tried Alt Gr h and Alt Gr underscore, without success.
      – I can’t type repaya, rakaransaya and yansaya, for which I would presumably need a combination of keys including zero width join.
      Has anyone else experienced these problems, with Sinhala or with other Asian languages? Any suggestions, please, for how to solve them?

      #79666
      Member
      ModdIt
        Helpful
        Up
        0
        ::

        There is a keyboard layout editor project, link below which might be of help,

        https://github.com/simos/keyboardlayouteditor

        #79669
        Moderator
        caprea
          Helpful
          Up
          0
          ::

          This might be interesting, too.
          https://github.com/para-d/si-wijesekara-keyboard

          #79678
          Member
          ModdIt
            Helpful
            Up
            0
            ::

            Found this in older debian forum posts.
            Press the (left) ctrl+shift+u together, you should get u underlined, then you can type in the correct hexcode :
            https://ascii.cl/

            Code: Select all ctrl-shft-u 3E = > ctrl-shft-u 3C= <

            May be useful for testing before making key changes or code modification.

            And a mapping tutorial which looks pretty understandable.

            http://xahlee.info/linux/linux_xmodmap_tutorial.html

            • This reply was modified 1 year, 1 month ago by ModdIt.
            #79702
            Member
            parippu
              Helpful
              Up
              0
              ::

              Thanks, both of you, for your suggestions. My first thoughts in response are:
              The method for displaying Unicode characters is immediately useful. The two basic characters that I am missing are:
              U+0DA4 ඤ
              U+0DA5 ඥ

              And yes, I had seen the github si-wijesekara-keyboard file, which contains some interesting things, but I need to investigate it further. And the keyboard layout editor could also be useful.

              On my computer, the xkb directory has a file for Sinhala characters (/usr/share/X11/xkb/symbols/lk), based on a US keyboard, but it seems to be for a phonetic transcription input method, with a layout that is very different from the Wijesekara layout, which is the standard layout for physical Sinhala keyboards. So it would not be a question of making a few modifications to the existing xkb Sinhala file but of creating a new one, and I think that would be very complicated. Sinhala characters are composites consisting of a basic syllable character (such as ka) plus various diacritic signs and special symbols attached around it, on all four sides, to change the inherent vowel or add other consonants (e.g. to change ka to kro). The composite character is entered by pressing a sequence of keys, with or without modifiers.

              At present, with Ibus + m17n installed and loaded at startup, I can choose between three keyboard layouts: Spanish (which corresponds to my physical keyboard), Sinhala, and Punjabi (because starting to learn Punjabi is one of the things I want to do sometime soon). If I select the Wijesekara Sinhala layout I can type nearly all of the Sinhala characters, and the file /usr/share/m17n/si-wijesekera.mim seems to contain all the characters, including the two that I’m missing, and routines for special symbols and zero width join, so I think the easiest solution is going to be to stick with Ibus + m17n and find a way to overcome the specific problems that it presents on my Spanish computer.

              My impression is that my Spanish keyboard layout is overriding part of the Sinhala layout that Ibus is providing. The two missing characters that I’ve shown above should be mapped, I think, to the two “dead” keys that are used in Spanish to add a grave or acute accent to vowels. I say “dead” because on their own they display nothing; they simply modify the vowel key that is pressed after them. At present, if I select the Sinhala keyboard, those keys seem to do nothing when pressed unmodified or with shift, either on their own or when followed by other keys. Curiously, when I select the Punjabi layout, those keys produce normal Punjabi characters, so the problem seems to be specific to Sinhala.

              The other main problem is that with this Ibus layout I can’t find a ZWJ (zero width join) key, which is needed to attach some of the special symbols to a basic syllable character. I think it should be mapped to Alt Gr plus the extreme right key in the first letter row, which is forward slash on a US keyboard and underscore on my Spanish keyboard, but at present that doesn’t seem to work.

              If these two problems can be solved (the two missing characters and the zero width join key), then Ibus + m17n will give me a full Sinhala character set, and that should be easier than creating a complete key map file from scratch. The two missing characters and the zero width join key appear in the m17n file, but something extraneous seems to be preventing them from working.

              #79719
              Member
              ModdIt
                Helpful
                Up
                0
                ::

                We are doing our best to help, probably most forum members have never heard of Sinhala
                or ever seen sinhala characters so not easy. I edited keyboard codes many years ago so
                have some idea of the problems but no recent experience.

                There seems to be still some linux activity in Sri Lanka, did you already try to contact
                Suchetha Wijenayake or manage to find any user group. It looks like one may be face book
                centered. Otheres have definitely ceased to exist.

                #79737
                Member
                parippu
                  Helpful
                  Up
                  0
                  ::

                  Thanks. I understand and I appreciate your help and your suggestions. I’ll do as you say and try to find Linux groups in Sri Lanka.

                  #79744
                  Member
                  madibi
                    Helpful
                    Up
                    0
                    ::

                    This suggestion may be useful:
                    with the command “xev” you know the code of the button you push,
                    knowing that info, you use the command “xmodmap” in order to say to that button to do what you want.

                    As an example:
                    xmodmap -e “keycode 134 = ISO_Level3_Shift”

                    With the above line, on a MacBook Pro, the right apple command (= keycode 134) was emulating the AltGr

                    If you know the name of the characters you need, then you can change the map of every single button of your keyboard.
                    In the help page of xmodmap you can find a list of all the characters. So I am convinced that with a bit of research you can find what you want.
                    I cannot help you because I don’t know wijesekara-sinhala.
                    Good luck!
                    m

                    • This reply was modified 1 year, 1 month ago by madibi.
                    • This reply was modified 1 year, 1 month ago by madibi.
                    #79814
                    Member
                    parippu
                      Helpful
                      Up
                      0
                      ::

                      The command xev certainly gives useful information. I’ll experiment with xmodmap to redefine keys. Many thanks.

                      #79820
                      Member
                      madibi
                        Helpful
                        Up
                        0
                        ::

                        In fact as far as I have understood from your posts, you have two working keys that do nothing with the keyboard layout that you’d like to use.
                        I imagine that using a command like:

                        xmodmap -e “keycode (xev_output_of_the_button_you_want_to_use) = (your_character_code)”

                        you can get the desired result

                        m

                        • This reply was modified 1 year, 1 month ago by madibi.
                        #79895
                        Member
                        parippu
                          Helpful
                          Up
                          0
                          ::

                          The computer I’m using has a Spanish keyboard.
                          With Ibus + m17n loaded, I can choose between three keyboard layouts (Spanish, Sinhala, Punjabi) by clicking on the Ibus icon in the system tray.
                          With the Spanish layout selected, the command xev followed by a key press gives me information about that key. And xmodmap gives me a key map for the Spanish layout.
                          With the Sinhala layout selected, the command xev still gives me information for the Spanish layout, not for Sinhala. And xmodmap gives me nothing.
                          My provisional conclusion is that the X system doesn’t see and interact with the Ibus layouts.
                          So I can use xev and xmodmap to get information about my Spanish layout and modify it; and probably I can do the same if I add other layouts that are in the /usr/share/X11/xkb/symbols directory. But the Ibus + m17n layouts are in a different directory and probably I can’t use X commands to modify Ibus layouts.
                          Also, the two Sinhala characters that are missing when I select the Sinhala layout are in fact present in the Ibus Wijesekara Sinhala layout file. So it looks as if the problem is not in the layout file itself, but in something else that is preventing part of the layout from working.
                          As I indicated in an earlier post, following Moddit’s suggestion, I’m going to try to contact Linux groups in Sri Lanka.
                          And I’m also going to experiment with the phonetic Sinhala input method, which is available in X11, and see if I can adapt to it.
                          Thanks for your ideas.

                          #79957
                          Member
                          madibi
                            Helpful
                            Up
                            0
                            ::

                            Dear parippu,
                            3 further suggestions / considerations

                            1. can it be a problem with your keyboard?
                            Can you do an experiment with another keyboard?

                            2. once on a keyboard, which at the time was my only one, I poured some coffee which made only some keys unusable.
                            So with the “xev – xmodmap” method, I remapped some keys that I never use (or a combination of keys), to replace the damaged keys – of course with Sinhala selected. (example of keys never used by me: right-shift, right-ctrl).

                            3. Laptops often have an “Fn” key which is usually blue.
                            When I try the output of the “Fn” key with xev, no output comes out, but if I use it it works anyway.
                            This observation suggests that if you try the two keys that give you no response, maybe they can work in combination with others, just like the “Fn” keys on my laptop. In this case you may have some other possibility of combination of keys that may help you.

                            At this point I have run out of ideas. I wish you that somehow you can solve your problem 🙂

                            m

                            • This reply was modified 1 year, 1 month ago by madibi.
                            • This reply was modified 1 year, 1 month ago by madibi.
                            #80033
                            Member
                            parippu
                              Helpful
                              Up
                              0
                              ::

                              Many thanks. But I don’t think any of these things apply in this situation.

                            Viewing 13 posts - 1 through 13 (of 13 total)
                            • You must be logged in to reply to this topic.