;; bn-unijoy.mim -- Bengali input method simulating Unijoy keyboard.
;; Copyright (C) 2005, 2008
;;   National Institute of Advanced Industrial Science and Technology (AIST)
;;   Registration Number H15PRO112

;; This file is part of the m17n database; a sub-part of the m17n
;; library.

;; The m17n library is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation; either version 2.1 of
;; the License, or (at your option) any later version.

;; The m17n library is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
;; Lesser General Public License for more details.

;; You should have received a copy of the GNU Lesser General Public
;; License along with the m17n library; if not, write to the Free
;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

(input-method bn unijoy)

(description "Bengali input method simulating Unijoy keyboard layout.
  <http://ekushey.org/?page/uni_joy_layout>
")

(title "ক")

(map
 (livekey
  ("`" "‌") ;; ZERO WIDTH NON-JOINER
  ("1" "১") ;; BENGALI DIGIT ONE
  ("2" "২") ;; BENGALI DIGIT TWO
  ("3" "৩") ;; BENGALI DIGIT THREE
  ("4" "৪") ;; BENGALI DIGIT FOUR
  ("5" "৫") ;; BENGALI DIGIT FIVE
  ("6" "৬") ;; BENGALI DIGIT SIX
  ("7" "৭") ;; BENGALI DIGIT SEVEN
  ("8" "৮") ;; BENGALI DIGIT EIGHT
  ("9" "৯") ;; BENGALI DIGIT NINE
  ("0" "০") ;; BENGALI DIGIT ZERO

  ("q" "ঙ") ;; BENGALI LETTER NGA
  ("w" "য") ;; BENGALI LETTER YA
  ("e" "ড") ;; BENGALI LETTER DDA
  ("r" "প") ;; BENGALI LETTER PA
  ("t" "ট") ;; BENGALI LETTER TTA
  ("y" "চ") ;; BENGALI LETTER CA
  ("u" "জ") ;; BENGALI LETTER JA
  ("i" "হ") ;; BENGALI LETTER HA
  ("o" "গ") ;; BENGALI LETTER GA
  ("p" "ড়") ;; BENGALI LETTER RRA
  ("\\" "ঃ") ;; BENGALI SIGN VISARGA

  ("a" "ৃ") ;; BENGALI VOWEL SIGN VOCALIC R
  ("s" "ু") ;; BENGALI VOWEL SIGN U
  ("d" "ি") ;; BENGALI VOWEL SIGN I
  ("f" "া") ;; BENGALI VOWEL SIGN AA
  ("h" "ব") ;; BENGALI LETTER BA
  ("j" "ক") ;; BENGALI LETTER KA
  ("k" "ত") ;; BENGALI LETTER TA
  ("l" "দ") ;; BENGALI LETTER DA

  ("z" "্র") ;; BENGALI SIGN VIRAMA + BENGALI LETTER RA
  ("x" "ো") ;; BENGALI VOWEL SIGN O
  ("c" "ে") ;; BENGALI VOWEL SIGN E
  ("v" "র") ;; BENGALI LETTER RA
  ("b" "ন") ;; BENGALI LETTER NA
  ("n" "স") ;; BENGALI LETTER SA
  ("m" "ম") ;; BENGALI LETTER MA

  ("~" "‍") ;; ZERO WIDTH JOINER
  ("$" "৳") ;; BENGALI RUPEE SIGN
  ("^" "÷") ;; DIVISION SIGN
  ("&" "ঁ") ;; BENGALI SIGN CANDRABINDU
  ("*" "×") ;; MULTIPLICATION SIGN

  ("Q" "ং") ;; BENGALI SIGN ANUSVARA
  ("W" "য়") ;; BENGALI LETTER YYA
  ("E" "ঢ") ;; BENGALI LETTER DDHA
  ("R" "ফ") ;; BENGALI LETTER PHA
  ("T" "ঠ") ;; BENGALI LETTER TTHA
  ("Y" "ছ") ;; BENGALI LETTER CHA
  ("U" "ঝ") ;; BENGALI LETTER JHA
  ("I" "ঞ") ;; BENGALI LETTER NYA
  ("O" "ঘ") ;; BENGALI LETTER GHA
  ("P" "ঢ়") ;; BENGALI LETTER RHA
  ("|" "ৎ") ;; BENGALI SIGN KHANDATA

  ("A" "র্") ;; BENGALI LETTER RA + BENGALI SIGN VIRAMA
  ("S" "ূ") ;; BENGALI VOWEL SIGN UU
  ("D" "ী") ;; BENGALI VOWEL SIGN II
  ("F" "অ") ;; BENGALI LETTER A
  ("G" "।") ;; DEVANAGARI DANDA
  ("H" "ভ") ;; BENGALI LETTER BHA
  ("J" "খ") ;; BENGALI LETTER KHA
  ("K" "থ") ;; BENGALI LETTER THA
  ("L" "ধ") ;; BENGALI LETTER DHA

  ("Z" "্য") ;; BENGALI SIGN VIRAMA + BENGALI LETTER YA
  ("X" "ৌ") ;; BENGALI VOWEL SIGN AU
  ("C" "ৈ") ;; BENGALI VOWEL SIGN AI
  ("V" "ল") ;; BENGALI LETTER LA
  ("B" "ণ") ;; BENGALI LETTER NNA
  ("N" "ষ") ;; BENGALI LETTER SSA
  ("M" "শ") ;; BENGALI LETTER SHA


  ((A-=) "≠")	;; NOT EQUAL TO

  ((A-e) "ঈ")	;; BENGALI LETTER II
  ((A-u) "ঊ")	;; BENGALI LETTER UU
  ((A-i) "ঐ")	;; BENGALI LETTER AI
  ((A-o) "ঔ")	;; BENGALI LETTER AU

  ((A-a) "ঋ")	;; BENGALI LETTER VOCALIC R
  ((A-s) "উ")	;; BENGALI LETTER U
  ((A-d) "ই")	;; BENGALI LETTER I
  ((A-f) "আ")	;; BENGALI LETTER AA
  ((A-g) "্")	;; BENGALI SIGN VIRAMA //not a dead key now
  ((A-h) "ৰ")	;; BENGALI LETTER RA WITH MIDDLE DIAGONAL

  ((A-x) "ও")	;; BENGALI LETTER O
  ((A-c) "এ")	;; BENGALI LETTER E
  ((A-v) "ৱ")	;; BENGALI LETTER RA WITH LOWER DIAGONAL
  ((A-.) "়")	;; BENGALI SIGN NUKTA

  ((A-!) "৴")	;; BENGALI CURRENCY NUMERATOR ONE
  ((A-@) "৵")	;; BENGALI CURRENCY NUMERATOR TWO
  ((A-\#) "৶")	;; BENGALI CURRENCY NUMERATOR THREE
  ((A-$) "৷")	;; BENGALI CURRENCY NUMERATOR FOUR
  ((A-%) "৲")	;; BENGALI RUPEE MARK
  ((A-&) "৺")	;; BENGALI ISSHAR
  ((A-\)) "৸") ;;BENGALI CURRENCY NUMERATOR ONE LESS THAN THE DENOMINATOR
  ((A-_) "৹")	;; BENGALI CURRENCY DENOMINATOR SIXTEEN

  ((A-Q) "ঌ")	;; BENGALI LETTER VOCALIC L
  ((A-W) "ৡ")	;; BENGALI LETTER VOCALIC LL
  ((A-I) "ঽ")	;; BENGALI LETTER AVAGRAHA

  ((A-Z) "ৢ")	;; BENGALI VOWEL SIGN VOCALIC L
  ((A-X) "ৗ")	;; BENGALI AU LENGTH MARK
  ((A-C) "ৠ")	;; BENGALI LETTER VOCALIC RR
  ((A-V) "ৣ")	;; BENGALI VOWEL SIGN VOCALIC LL
  ((A-B) "ৄ")	;; BENGALI VOWEL SIGN VOCALIC RR
  ((A-<) "≤")	;; LESS-THAN OR EQUAL TO
  ((A->) "≥")	;; GREATER-THAN OR EQUAL TO
  )

 (deadkey
  ("g" "্") ;; BENGALI SIGN VIRAMA
  )

 (independent
  ("f" (delete @-) "আ") ;; BENGALI LETTER AA
  ("d" (delete @-) "ই") ;; BENGALI LETTER I
  ("D" (delete @-) "ঈ") ;; BENGALI LETTER II
  ("s" (delete @-) "উ") ;; BENGALI LETTER U
  ("S" (delete @-) "ঊ") ;; BENGALI LETTER UU
  ("a" (delete @-) "ঋ") ;; BENGALI LETTER VOCALIC R
  ("c" (delete @-) "এ") ;; BENGALI LETTER E
  ("C" (delete @-) "ঐ") ;; BENGALI LETTER AI
  ("x" (delete @-) "ও") ;; BENGALI LETTER O
  ("X" (delete @-) "ঔ") ;; BENGALI LETTER AU
  ("G" (delete @-) "॥") ;; DEVANAGARI DOUBLE DANDA
  ))

(state
 (init
  (livekey)
  (deadkey (shift virama)))

 (virama
  (independent (shift init))
  (nil (shift init))))

;; Local Variables:
;; coding: utf-8
;; mode: lisp
;; End:
