如何更改 squeak 中的自动完成按钮?
How to change the auto completion button in squeak?
有没有办法更改快捷方式以在 squeak vm 中调用自动完成(标准是 tab
)?
提前致谢
(我假设你使用 OCompletion 或 ECompletion)
目前更改此设置的唯一方法是更改代码。
OController>>handleKeystrokeBefore: kbEvent editor: theEditor
"I return a boolean. true when I have handled the event and no futher processing is needed by the caller."
| keyValue ctrl cmd down tab colon alphanum del esc enter up |
self editor: theEditor.
self setModel: theEditor model.
keyValue := kbEvent keyValue.
ctrl := kbEvent controlKeyPressed.
cmd := kbEvent commandKeyPressed.
down := keyValue = 31.
up := keyValue = 30.
tab := kbEvent keyCharacter = Character tab. "<-- change this to your desired key"
enter := kbEvent keyCharacter = Character cr.
colon := kbEvent keyCharacter = $:.
alphanum := kbEvent keyCharacter isAlphaNumeric.
"..."
或者,当你只使用 ECompletion
ECController>>handleKeystrokeBefore: aKeyboardEvent editor: anEditor
"I return a boolean. true when I have handled the event and no futher processing is needed by the caller."
| theEditor keyValue controlKeyPressed isSpaceKey |
self editor: anEditor.
theEditor := self editor.
self setModel: theEditor model.
keyValue := aKeyboardEvent keyValue.
controlKeyPressed := aKeyboardEvent controlKeyPressed.
isSpaceKey := #(0 32 ) includes: keyValue.
"Ctrl-Space or Tab for open"
self isMenuOpen
ifFalse: [(isSpaceKey & controlKeyPressed
or: [keyValue = 9 " <-- change this to your desired key"
and: [theEditor isCaretBehindChar
and: [controlKeyPressed not]]])
"..."
有没有办法更改快捷方式以在 squeak vm 中调用自动完成(标准是 tab
)?
提前致谢
(我假设你使用 OCompletion 或 ECompletion)
目前更改此设置的唯一方法是更改代码。
OController>>handleKeystrokeBefore: kbEvent editor: theEditor
"I return a boolean. true when I have handled the event and no futher processing is needed by the caller."
| keyValue ctrl cmd down tab colon alphanum del esc enter up |
self editor: theEditor.
self setModel: theEditor model.
keyValue := kbEvent keyValue.
ctrl := kbEvent controlKeyPressed.
cmd := kbEvent commandKeyPressed.
down := keyValue = 31.
up := keyValue = 30.
tab := kbEvent keyCharacter = Character tab. "<-- change this to your desired key"
enter := kbEvent keyCharacter = Character cr.
colon := kbEvent keyCharacter = $:.
alphanum := kbEvent keyCharacter isAlphaNumeric.
"..."
或者,当你只使用 ECompletion
ECController>>handleKeystrokeBefore: aKeyboardEvent editor: anEditor
"I return a boolean. true when I have handled the event and no futher processing is needed by the caller."
| theEditor keyValue controlKeyPressed isSpaceKey |
self editor: anEditor.
theEditor := self editor.
self setModel: theEditor model.
keyValue := aKeyboardEvent keyValue.
controlKeyPressed := aKeyboardEvent controlKeyPressed.
isSpaceKey := #(0 32 ) includes: keyValue.
"Ctrl-Space or Tab for open"
self isMenuOpen
ifFalse: [(isSpaceKey & controlKeyPressed
or: [keyValue = 9 " <-- change this to your desired key"
and: [theEditor isCaretBehindChar
and: [controlKeyPressed not]]])
"..."