跳转到内容

Rebol 编程/find-key-face

来自维基教科书,开放的书籍,开放的世界
FIND-KEY-FACE face keycode 

搜索面以确定键码是否适用。

FIND-KEY-FACE 是一个函数值。

  • face -- (类型: 对象)
  • keycode -- (类型: 字符字)

源代码

[编辑 | 编辑源代码]
find-key-face: func [
    "Search faces to determine if keycode applies." 
    face [object!] keycode [char! word!] /local w f result
][
    either all [
        w: in face 'keycode 
        w: get w 
        any [keycode = w all [block? w find w keycode]]
    ] [face] [
        w: in face 'pane 
        either block? w: get w [
            result: none 
            foreach f w [if all [object? f f: find-key-face f keycode] [result: f break]] 
            result
        ] [
            if object? :w [find-key-face w keycode]
        ]
    ]
]
华夏公益教科书