Bạn cần PocketCM Keyboard 0.15 hoặc cao hơn. A more complete documentation will come, but if you're familiar with theming PocketCM Contact, you should be able to make some nice stuff. A little change for skinner, you can download an exe version of PocketCM Keyboard, this is not useful as a SIP (doesn't work in most application), but allow you to more easily test your theme (as you can kill an exe, not a sip).
Key Key settings are defined either for all key, for all key for a layout, or for a specific key.- Like any settings: key.*.[setting name] set the setting for all key elements
- If you want to specify a setting for all key in a given layout use: [layout name].key.*.[setting name]=...
- For a specific key, of course, it's like any other setting: key.[key name].[setting name]=...
- And for a specific key, for a specific layout [layout name].key.[key name].[setting name]=...
Layout To specify a layout, you can specify: keyboardlayout.layout1.layout=qwertyuiop\nasdfghjkl'\n\Szxcvbnm\B\n\M \N
- layout1 is the layout name, you can specify whatever you want. The only thing to remember is that layout1 is the default layout (the first one shown)
- the keyboard read this setting, ang generate key for each letter here, so you end up with 10 keys for the first row.
- \n is a special charater that breaks the line (add a new row)
- \ is a special character: it takes the next character to generate the key, so with \N you end up with a key named \N
The important thing to remember here: pocketcm keyboard generate keys out of it, each key can be configured with the key settings. So if for instance we take our \N key, we can adjust the settings for this key: key.\N.width=40 will just make the key 40 pixels wide. Key actions With previous version, action where hardcoded, a given key was always generating the same action, no matter what. With this version, each key can be configured separately. To specify an action, you just set the action setting, for instance, if you want a return key, you can add the setting: key.\N.action=virtualkey(VK_RETURN) Which basically mean: for all layout, the \N key action is to simulate a virtualkey
VK_RETURN (which is a return). Please remember, the fact that the key name is \N is purely a convention! you can choose whatever you want. If you do for instance: key. .action=virtualkey (VK_RETURN) that will change the behavior of the " " (generally used as space) for return. With great flexibility comes potential issue: you can make a completely screwed-up layout (on the other side you can make very nice stuff not possible before). The possible actions are:- type() : just type the key name, so key.a.action=type() will type "a" when pressing the key, key.\N.action=type() will type "\N".
- type(SOME_TEXT) : will type SOME_TEXT so key.a.action=type(Hello World) will type "Hello World" every time the user press the a key (which is not expected, it's an exemple)
- typedtext() : will type the text contained in they "typedtext" key setting, so for instance: key.a.typedtext=:-) and key.a.action=typedtext() will print the smilies :-) when typed. (this construct allow to type parenthesis, that would be otherwise interpreted as closing command.)
- switch(LAYOUT) : will switch to keyboard layout named LAYOUT (note: you need setting for such a layout!)
- switch_once(LAYOUT) : same as switch, but come back to the previously active keyboard layout after one press
- subpanel(LAYOUT) : same as switch, but come back to the previously selected layout when the finger is released (see it as symbol pad on steroids)
- symbolpad(LAYOUT) : same as switch, but don't hide the previous layout, and position it close to the key pressed
- virtualkey(key1) : send a virtual key (virtual key are key that don't result on something typed, here is a list of available virtual key, things like VK_A is also allowed for the A key, etc... ).
- virtualkey(key1, key2) : same as virtualkey above, expect it simule: press of key1, press of key2, release of key2, release of key1. Useful for CTRL+C (copy) for instance: key.\\C.action=virtualkey(VK_CONTROL,VK_C)
- option() : goes to option
- quit() : exit the keyboard, only usefull for testing theme (it kill the app, so you can restart it), and only works in the exe version.
- repeat(DELAY) : you can add it for every action, on top of it, it just repeat the action if you stay pressed every DELAY milliseconds, for instance: key.\\B.long.action=virtualkey(VK_BACK),repeat(200) will send the virtualkey VK_BACK (which is a backspace) every 200ms when pressed.
You can also specify the "long.action" setting, which define the action triggered if you stay pressed, for instance: #define the layout symbolpad1 keyboardlayout.symbolpad1.layout=,\\<>[]-' #define it to be aligned on right keyboardlayout.symbolpad1.alignment=right #define that if I press the ' key for a long time, it does show the symbolad named "symbolpad1" key.'.long.action=symbolpad(symbolpad1) Default settings # GUI and general settings header.option.text=Options button.ok.text=Ok button.cancel.text=Cancel
list.option.box=0,42p,100%,-40p
separatorlabel.option.general.text=Appearence separatorlabel.option.advanced.text=Advanced separatorlabel.option.suggestion.text=Suggestions separatorlabel.option.feedback.text=Feedback
checkbutton.option.keyboard.suggestion.text=Make suggestion checkbutton.option.keyboard.autosuggestion.text=Auto-apply suggestion button.option.select.dictionary.text=Dictionary: %s button.option.select.theme.text=Theme: %s button.option.dump.text=Dump settings
checkbutton.option.keyboard.ticksound.text=Tick sound on press checkbutton.option.keyboard.vibrate.text=Vibrate checkbutton.option.keyboard.feedback.text=Show feedback key checkbutton.option.keyboard.instantfeedback.text=Show feedback instantaneously
window.*.title.text=PocketCM Keyboard window.feedback.hidden=1 window.feedback.title.text=feedbackPCMK
window.suggestion.title.text=suggestionPCMK window.suggestion.box=auto(top,left)
# define the suggestion box suggestion.*.background=fill(#FFFFFF),solidborder(#000000,1) suggestion.missing.background=fill(#FF4444),solidborder(#000000,1) suggestion.alternate.background=fill(#4444FF),solidborder(#000000,1) suggestion.*.box=auto() suggestion.*.text.box=7,7,-7,-7 suggestion.*.offset.y=20 suggestion.*.font=14p,regular,Segoe UI,#000000,center
list.suggestions.window.box=15,15,-15,-15 list.suggestions.background=fill(#FFFFFF),solidborder(#000000,1)
window.*.box=auto(bottom) window.option.box=0,0,100%,100% window.feedback.box=auto(top,left)
# define the feedback feedback.*.box=0,0,65,110 feedback.*.background=fill(#FFFFFF),solidborder(#000000,1) feedback.*.font=16p,bold,Segoe UI,#000000,center feedback.*.text.box=0,10%,100%,100% feedback.*.offset.x=0 feedback.*.offset.y=0
# define the distance allowed for suggestion keyboardlayout.*.allowed.distance=40
#define the default layout keyboardlayout.layout1.layout=qwertyuiop\\nasdfghjkl'\\n\\Szxcvbnm\\B\\n\\M \\N
# note how like for every setting, you can make some landscape (or portrait) specific landscape.keyboardlayout.layout1.layout=123qwertyuiop\\n456asdfghjkl'\\n789\\Szxcvbnm\\B\\n\\M \\N keyboardlayout.layout2.layout=QWERTYUIOP\\nASDFGHJKL'\\n\\SZXCVBNM\\B\\n\\M \\N keyboardlayout.layout3.layout=éè&€$789*_\\n.,:;/456()\\n\\S@\"-+123\\B\\n\\M?! =0\\N keyboardlayout.layout4.layout=êàùîâ789*%\\nôç\\\\#~456\\[\\]\\n\\3<>-+123\\B\\n\\M?! =0\\N
# define the background for all layout keyboardlayout.*.background=fill(#FFFFFF)
# SPECIFIC FOR TESTING PURPOSE # WILL QUIT WHEN YOU PRESS Q key.q.action=quit() key.o.action=option()
# the default action is to type the name of the key key.*.action=type() # excpet for the \\ key, where we type \ key.\\.action=type(\)
# define the default width/height of the keys key.*.width=24 key.*.height=31 landscape.default.keywidth=32
# for the ' show a symbol pad key.'.long.action=symbolpad(symbolpad1) keyboardlayout.symbolpad1.layout=,\\\\<>[]-' keyboardlayout.symbolpad1.alignment=right
# define how the key look, note it's just background, you can specify whatever you want key.*.background.pressed=fill(#FFFFFF),margin(1),margintop(0),solidborder(#888888,1) key.*.font.pressed=none key.*.background=fill(#FFFFFF),margin(1),solidborder(#888888,1) key.*.font=12p,bold,Segoe UI,#333333,center
# the rest is specific keys configuration, I guess you can figure it out key.\\S.width=36 key.\\N.width=40 layout1.key.\\S.action=switch_once(layout2) layout2.key.\\S.action=switch_once(layout1) layout1.key.\\S.long.action=switch(layout2) layout2.key.\\S.long.action=switch(layout1)
key.\\..action=type(...)
key.\\N.width=40 key.\\N.long.action=symbolpad(functions) key.\\N.font=9p,regular,Segoe UI,#333333,center
key.\\M.width=40 key.\\M.long.action=symbolpad(symbols) keyboardlayout.symbols.layout=.,?!:\\.&@() key.\\M.text=@?123 key.\\M.font=9p,regular,Segoe UI,#333333,center layout1.key.\\M.action=switch(layout3) layout3.key.\\M.action=switch(layout1)
key.\\B.width=36 key.\\B.long.action=virtualkey(VK_BACK),repeat(200) key.\\B.text=<--
key.\\B.font=9p,regular,Segoe UI,#333333,center
key.\\B.action=virtualkey(VK_BACK) keyboardlayout.functions.layout=\\O\\X\\C\\P\\N key.\\N.text=Return key.\\X.text=Cut
key.\\C.text=Copy key.\\P.text=Paste
key.\\O.text=Options key.\\S.text=Shift
key.\\..text=... key.\\N.action=virtualkey(VK_RETURN) key.\\X.action=virtualkey(VK_CONTROL,VK_X) key.\\C.action=virtualkey(VK_CONTROL,VK_C) key.\\P.action=virtualkey(VK_CONTROL,VK_V)
key.\\O.action=option()
functions.key.\\N.width=48
functions.key.\\X.width=48
functions.key.\\C.width=48
functions.key.\\P.width=48
functions.key.\\O.width=48
key.\\N.font=9p,regular,Segoe UI,#333333,center
key.\\X.font=9p,regular,Segoe UI,#333333,center
key.\\C.font=9p,regular,Segoe UI,#333333,center
key.\\P.font=9p,regular,Segoe UI,#333333,center
key.\\O.font=9p,regular,Segoe UI,#333333,center
# is breaking define if it break suggestions
#(for instance typing ! will suggest for everything before, then consider a new word is starting) key.\\N.isbreaking=1
key.!.isbreaking=1
key...isbreaking=1 key.?.isbreaking=1
key.:.isbreaking=1 key.@.isbreaking=1
key.(.isbreaking=1 key.).isbreaking=1
key. .isbreaking=1 key. .width=-1 layout3.key. .width=64
key. .hit.box=0,10%,-1,-1
key. .background=fill(#AAAAFF),margin(2),solidborder(#000000,1)
key.i.alternatives=î,ï
key.a.alternatives=à,â
key.o.alternatives=ô
key.c.alternatives=ç
key.'.alternatives=-
key.e.alternatives=é,è,ê,ë
|