;; lsymbol.mim -- input method for various symbols. ;; Copyright (C) 2014 K. Handa ;; This file is 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 t lsymbol) (description (_"Input method for symbols with relatively longer key sequences. It provides access to a broad category of symbols by using the technique of showing multiple alternatives based on the starter keys pressed. For instance, \"/->\" -> arrows (e.g. โ†’โ†‘) \"/||\" -> hand genstures (e.g. ๐Ÿ‘๐Ÿ‘Ž) \"/:)\" -> happy faces (e.g. โ˜บ๐Ÿ˜ƒ) \"/:(\" -> unhappy faces (e.g. ๐Ÿ˜ข๐Ÿ˜ก) \"/<3\" -> hearts (e.g. โ™ฅโ™ก) \"/*\" -> flowers and stars (e.g. ๐ŸŒนโ˜…) \"&&\" -> spiritual (e.g. โ˜ธโ˜ฏ) \"/xx\" -> checks (e.g. โœ”โœ˜) \"$\" -> currency (โ‚ฌยฃ) \"@\" -> legal/text signs (e.g "ยฉยถ") The user can select the appropriate symbol using โ†‘,โ†“,โ†’,โ† (or C-p, C-n, C-f, C-b) keys and/or the digits. Other miscellaneous keys are: \"//\" -> \"/\" \"/...\" -> \"โ€ฆ\" This input methods is registered as one of fallback input methods by default. See the documentation page of m17n input methods for more detail. ")) ;; Some guidelines for determining shortcut sequences: ;; * Where appropriate, provide access to a broad category of ;; symbols by using the technique of showing multiple alternatives ;; based on the starter keys pressed. ;; ;; * Prefer restricting the size of a character cluster to 6 - so ;; that the user can use digits more accessible to the left hand, ;; with arrow keys using the right hand. For example, prefer ;; "โ™ฅโ™ก๐Ÿ’”๐Ÿ’–๐Ÿ’˜๐Ÿ’“" "๐Ÿ’ž๐Ÿ’•๐Ÿ’Œ" to "โ™ฅโ™ก๐Ÿ’”๐Ÿ’–๐Ÿ’˜๐Ÿ’“๐Ÿ’ž๐Ÿ’•๐Ÿ’Œ". ;; * Within a group (say hand gestures), cluster semantically ;; similar symbols together. ;; * Keyboard shortcuts used in popular applications provide clues ;; as to what the appropriate ;; Some references: ;; * Some statistics are available online. Example ;; http://www.scribd.com/doc/262594751/SwiftKey-Emoji-Report ;; (guardian highlight) and http://emojitracker.com/. Although, this ;; is biased towards populations who are already tech savvy + have ;; the time to type emojis easily and does not give as much weight to ;; people who are just beginning to use IM/ digital communication. ;; * There are other indications of popularity - such as other ;; products (say MS Office or Facebook or Google Hangouts, who would ;; presumably have adapted towards user expectations) providing ;; shortcuts for these emoji-s. ;; ;; * General lists: http://fsymbols.com/computer/ http://emojipedia.org/ ;; * Emoticon shortcuts in MS Office: https://support.office.com/en-us/article/Keyboard-shortcuts-for-emoticons-dda403dc-ffe9-4cbb-9b9f-aed845ff8b8c ;; * Facebook shortcuts: http://www.shoutmeloud.com/list-of-facebook-keyboard-shortcuts-and-emoticons.html http://emojicodes.com/ (map ;; All starter keys must be registered here. (starter ("/" "/")) ;; Mapping table. Each key sequence should not include the starter ;; key. (map ("/" "/") ("..." "โ€ฆ")) (multi-choice ;; arrows ("->" (delete @0) ("โ†’โ†โ†‘โ†“" "๐Ÿ‘‰๐Ÿ‘ˆ๐Ÿ‘†๐Ÿ‘‡โœ‹" "โ–บโ—„โ–ฒโ–พโ—คโ—ฅโ—ฃโ—ข")) ;; hand gestures ("||" (delete @0) ("๐Ÿ‘๐Ÿ‘Ž๐Ÿ‘Œโœ‹๐Ÿ‘๐Ÿ™†" "๐Ÿ™๐Ÿ‘‹๐Ÿ™ŒโœŒโœŠ๐Ÿ‘Š" "๐Ÿ’๐Ÿ™‹๐Ÿ’ชโœ๐Ÿ’†๐Ÿ’…")) ;; happy faces (":)" (delete @0) ("โ˜บ๐Ÿ˜ƒ๐Ÿ˜…๐Ÿ˜†๐Ÿ˜‰๐Ÿ˜‡๐Ÿ˜‚" "๐Ÿ˜๐Ÿ˜›๐Ÿ˜œ๐Ÿ˜๐Ÿ˜‹๐Ÿ˜‰" "๐Ÿ’๐Ÿ’‹๐Ÿ˜๐Ÿ˜˜๐Ÿ˜š๐Ÿ˜ฝ๐Ÿ˜ป")) ;; unhappy faces (":(" (delete @0) ("๐Ÿ˜ข๐Ÿ˜ฉ๐Ÿ˜ก๐Ÿ˜ญ๐Ÿ˜ช" "๐Ÿ™ˆ๐Ÿ™Š๐Ÿ™‰")) ;; neutral faces (":|" (delete @0) ("๐Ÿค”")) ;; hearts ("<3" (delete @0) ("โ™ฅโ™ก๐Ÿ’”๐Ÿ’–๐Ÿ’˜๐Ÿ’“" "๐Ÿ’ž๐Ÿ’•๐Ÿ’Œ๐Ÿ’‘๐Ÿ˜๐Ÿ˜˜")) ;; *-like things: flowers, stars, other bright things, snowflakes ("*" (delete @0) ("๐ŸŒน๐Ÿ’โโœฝ" "โ˜…โ˜†โญ๐ŸŒŸ๐Ÿ’ซโœจ๐ŸŒ โœฏ๐ŸŒƒ" "โ˜€โ‚โœทโœธโœน๐ŸŒžโ›…๐ŸŒ…๐ŸŒ‡" "๐Ÿ’กโ˜„โšกฯŸ๐Ÿ”ฅ๐ŸŒˆ๐ŸŽ†" "โ„โ†โ…")) ;; spiritual symbols. ("&&" (delete @0) ("๐Ÿ’€โ˜ ๐Ÿ‘น๐Ÿ‘ผ๐Ÿ˜‡" "ๅๅโ˜ธโ˜ฏโ™‹โ˜ฌ" "โœโ˜ฆโœ™โœกโ˜ช๐Ÿ’’โ›ช" "๐Ÿ™ˆ๐Ÿ™Š๐Ÿ™‰")) ;; checks ("xx" (delete @0) ("โœ”โœ˜โ˜โ˜‘โ˜’")) ;; currency symbols ("$" (delete @0) ("โ‚ฌยฃยฅ๏ทผโ‚ฑโ‚น" "๐Ÿ’ฐ๐Ÿ’ต๐Ÿ’ถ๐Ÿ’ด๐Ÿ’ท")) ;; legal signs and text signs ("@" (delete @0) ("ยฉยฎโ„ขยงยถโ€ โ€ก")) ;; zero width joiners ("z" (delete @0) ("โ€Œ")) ) ;; Typing 1, 2, ..., 0 selects the 0th, 1st, ..., 9th candidate. (choose ("1" (select 0)) ("2" (select 1)) ("3" (select 2)) ("4" (select 3)) ("5" (select 4)) ("6" (select 5)) ("7" (select 6)) ("8" (select 7)) ("9" (select 8)) ("0" (select 9))) (change-candidate ((Left) (select @-)) ((C-b) (select @-)) ((Right) (select @+)) ((C-f) (select @+)) ((Up) (select @\[)) ((C-p) (select @\[)) ((Down) (select @\])) ((C-n) (select @\]))) (focus-move ;; When an input spot is moved, commit the current predit by shifting ;; to init. ((input-focus-move))) (focus-change ;; When an input focus is out or in, keep the current preedit. ((input-focus-out) (set KK @@) (sub KK 1) (undo KK)) ((input-focus-in) (set KK @@) (sub KK 1) (undo KK))) (backspace ((BackSpace))) (commit-preedit ((S-\ )) ((\ )))) (state (init (starter (show) (shift main))) (main (map (move @<) (delete 1) (move @>) (shift init)) (multi-choice (show) (shift select)) (nil (hide) (shift check-undo))) (check-undo ;; When Backspace is typed, cancel the last input. (backspace (undo)) (focus-move (shift init)) (focus-change) ;; When anything else is typed, produce the current candidate (if ;; any), and re-handle the last input in "init" state. (nil (hide) (shift init))) (select (t (set K @@) (sub K 1)) ;; When a number is typed, select the corresponding canidate, ;; produce it, and shift to "init" state. (focus-move (shift init)) (focus-change) (choose (hide) (shift init)) (change-candidate) (backspace (undo K)) ;; When key to force committing, commit the current preedit. (commit-preedit (shift init)) ;; When anything else is typed, produce the current candidate, ;; and re-handle the last input in "init" state. (nil (hide) (shift init)))) ;; Local Variables: ;; mode: lisp ;; coding: utf-8 ;; End: