;; fr-azerty.mim -- Input method for French simulating Azerty keyboard layout
;; Copyright (C) 2007
;;   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 fr azerty)

(documentation (_"Simulating Azerty keyboard on English keyboard.

     &1  é2  \"3  '4  (5  -6  è7  _8  ç9  à0  )°  =_  ²~
      aA  zZ  eE  rR  tT  yY  uU  iI  oO  pP  ^¨  $£
       qQ  sS  dD  fF  gG  hH  jJ  kK  lL  mM  ù%  *|
        wW  xX  cC  vV  bB  nN  ,?  ;.  :/  !§

'[' and '{' are used as a dead key to type a character with the
circumflex and diaeresis respectively (e.g. '[' 'e' -> \"ê\").

'Alt-2' and 'Alt-7' are used as a dead key to type a character
with tilde and grave respectively (e.g. 'Alt-2' 'n' -> \"ñ\").

'Ctrl-Alt-2' and 'Ctrl-Alt-7' can be used as 'Alt-2' and 'Alt-7'
respectively.

Azerty keyboard has one more key at the bottom left corner for
inputting \"<\" and \">\".  As a normal English keyboard doesn't
have such a key left, type '<' and '>' twice for \"<\" and \">\"
respectively."))

(title "AZ ")

(map
 (normal
  ("1" ?&)
  ("2" ?é)
  ("3" ?\")
  ("4" ?')
  ("5" ?\()
  ("6" ?-)
  ("7" ?è)
  ("8" ?_)
  ("9" ?ç)
  ("0" ?à)
  ("-" ?\))
  ("=" ?=)
  ("`" ?²)
  ("q" ?a)
  ("w" ?z)
  ("e" ?e)
  ("r" ?r)
  ("t" ?t)
  ("y" ?y)
  ("u" ?u)
  ("i" ?i)
  ("o" ?o)
  ("p" ?p)
  ;; ("[" ?^)
  ("]" ?$)
  ("a" ?q)
  ("s" ?s)
  ("d" ?d)
  ("f" ?f)
  ("g" ?g)
  ("h" ?h)
  ("j" ?j)
  ("k" ?k)
  ("l" ?l)
  (";" ?m)
  ("'" ?ù)
  ("\\" ?*)
  ("z" ?w)
  ("x" ?x)
  ("c" ?c)
  ("v" ?v)
  ("b" ?b)
  ("n" ?n)
  ("m" ?,)
  ("," ?\;)
  ("." ?:)
  ("/" ?!)

  ("!" ?1)
  ("@" ?2)
  ("#" ?3)
  ("$" ?4)
  ("%" ?5)
  ("^" ?6)
  ("&" ?7)
  ("*" ?8)
  ("(" ?9)
  (")" ?0)
  ("_" ?°)
  ("+" ?+)
  ("~" ?~)
  ("Q" ?A)
  ("W" ?Z)
  ("E" ?E)
  ("R" ?R)
  ("T" ?T)
  ("Y" ?Y)
  ("U" ?U)
  ("I" ?I)
  ("O" ?O)
  ("P" ?P)
  ;; ("{" ?¨)
  ("}" ?£)

  ("A" ?Q)
  ("S" ?S)
  ("D" ?D)
  ("F" ?F)
  ("G" ?G)
  ("H" ?H)
  ("J" ?J)
  ("K" ?K)
  ("L" ?L)
  (":" ?M)
  ("\"" ?%)
  ("|" ?µ)
  ("Z" ?W)
  ("X" ?X)
  ("C" ?C)
  ("V" ?V)
  ("B" ?B)
  ("N" ?N)
  ("M" ??)
  ("<" ?.)
  ("<<" ?<)
  (">" ?/)
  (">>" ?>)
  ("?" ?§))

 ;; Deadkeys
 (left-square-bracket
  ("["))

 (left-curly-bracket
  ("{"))

 (alt-2
  ((A-2))
  ((C-A-2)))

 (alt-7
  ((A-7))
  ((C-A-7)))

 ;; Letters with diacritical marks
 (circumflex
  ("[" ?^)
  ("q" ?â)
  ("e" ?ê)
  ("i" ?î)
  ("o" ?ô)
  ("u" ?û)
  ("Q" ?Â)
  ("E" ?Ê)
  ("I" ?Î)
  ("O" ?Ô)
  ("U" ?Û))

 (diaeresis
  ("{" ?¨)
  ("q" ?ä)
  ("e" ?ë)
  ("i" ?ï)
  ("o" ?ö)
  ("u" ?ü)
  ("y" ?ÿ)
  ("Q" ?Ä)
  ("E" ?Ë)
  ("I" ?Ï)
  ("O" ?Ö)
  ("U" ?Ü)
  ("Y" ?Ÿ))

 (tilde
  ("3" ?~)
  ("q" ?ã)
  ("n" ?ñ)
  ("o" ?õ))

 (grave
  ("q" ?à)
  ("e" ?è)
  ("i" ?ì)
  ("o" ?ò)
  ("u" ?ù)
  ("Q" ?À)
  ("E" ?È)
  ("I" ?Ì)
  ("O" ?Ò)
  ("U" ?Ù)))

(state
 (init
  (normal)
  (left-square-bracket (shift circumflex))
  (left-curly-bracket (shift diaeresis))
  (alt-2 (shift tilde))
  (alt-7 (shift grave)))

 (circumflex
  "AZ^"
  (circumflex (shift init)))

 (diaeresis
  "AZ¨"
  (diaeresis (shift init)))

 (tilde
  "AZ~"
  (tilde (shift init)))

 (grave
  "AZ`"
  (grave (shift init))))
