📄 keys
字号:
This document is here to explain the 'new' design of the keyinput/binding system. The old system became rather cumbersome and hard touse, and didn't allow for certain effects that were deemed useful.In other words, the ircII style meta-x keybindings are gone. In their placeis a NFA (non-deterministic finite-state automaton). What this means isthat it is now possible to bind a string of arbitrary length as a singlekeybinding without going through the hassle of the meta system. It alsomakes it possible to bind sequence initiators independantly of othersequences (for example, you can now bind ^[ (esc) as well as ^[[11~ (orsimilar)).The key mapping is now laid out in a way that facilitates fast lookups atany depth. The client creates an array at each level necessary. This cancreate some large memory use (depending on your definition of large) as eachmap will use 1K on 32 bit systems or 2k on 64 bit systems. In other words,if you have either extremely long bind-strings or lots of different maps allover the place, your memory usage may become quite cumbersome. A better wayto handle this should probably be investigated.Infrastructure is now in place to allow the user to create new bindingsymbols (SELF_INSERT, FORWARD_HISTORY, etc). Bindings are no longer storedin a table, but are now in a linked list. This should allow for bothscript and module created bindings to be placed into the client easily.In general, I have tried to retain command compatibility with the oldbinding commands, however this was not always possible, and for the sake ofextension I did not always do this. The most obvious example is the factthat 'metaX' is now gone. You can no longer bind to 'METAX_CHARACTER', andthat whole system has been greatly changed. In addition, some other changeshave been made to extend functionality where possible.-----------------------------------------------------------------------------What follows here is a list of examples of how to use the 'new' system, in arather tightly integrated way. For the most part, scripters will find thismore useful than lay-users, and if you are interested in using the system asa normal user, you should instead refer to the client's helpfiles on the/bind command.# Create a new keybinding function to act as a general 'cancel action'# command throughout the script. The handling of this is, of course, left# to the scripter. :)if (bindctl(FUNCTION CANCEL_ACTION EXISTS)) { echo *E* Binding function 'CANCEL_ACTION' already exists!} else { @bindctl(FUNCTION CANCEL_ACTION CREATE some_scripted_alias)}# Now bind escape to this new function. Also, bind escape+1 - escape+0 to# window changing actions. These will both work, now.bind ^[ cancel_actionfor xx in (1 2 3 4 5 6 7 8 9 0) { @bindctl(SEQUENCE ^[$xx parse_command window refnum_or_swap $xx)}# There are a lot more available uses for this system, and for full# documentation you should refer to the helpfiles for bind(4) and# bindctl(6).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -