[英]How to set Pharo keyboard shortcut for switching windows?
I have read that in Pharo it's possible to switch between windows using Alt-Tab. 我已经读过在Pharo中可以使用Alt-Tab在窗口之间切换。 But I've never been able to test this, because both OSes I commonly use capture Alt-Tab and use it for their own window switching. 但是我从来没有能够对此进行测试,因为我经常使用的两个OS都捕获Alt-Tab并将其用于它们自己的窗口切换。
I can't find a listing for Alt-Tab in the system Keymap Browser. 我在系统键盘映射浏览器中找不到Alt-Tab的列表。 Where is the key to switch windows defined, and how can I change it? 切换窗口的键在哪里定义,如何更改?
EDIT: I'd also love a "here's how you could have found out for yourself" type answer. 编辑:我也很喜欢“这是您本可以为自己找到的方式”类型的答案。
well... you hit one of our weaker spots :) 好吧...您碰到了我们的弱点之一:)
Keybindings are not in his best shape, but: 键绑定不是处于最佳状态,而是:
In any case, we are moving out this hardcode stuff, and you can check all currently available settings going to World Menu/System/Keymap Browser (they are a lot, we are also playing with ideas on how to show better this combinations... emacs style, popup notifications, etc.) 无论如何,我们正在淘汰这种硬编码的东西,您可以检查进入World Menu / System / Keymap Browser的所有当前可用的设置(它们很多,我们还在研究如何更好地显示这种组合的想法。 。emacs样式,弹出通知等)
I got this working by editing the "Basic, general navigation shortcuts among morphs" in package Morhpic-Core>>Kernel edit Morph class>>#morphNavigationShortcutsOn: 通过编辑包Morhpic-Core >>内核编辑Morph类>>#morphNavigationShortcutsOn中的“变形中的基本,通用导航快捷方式”,可以完成此工作:
There you can create shortcuts for "World navigateWindowForward"
etc. Took me a while to find keys that worked ok, most don't work well when in a textfield. 在那里,您可以为"World navigateWindowForward"
等创建快捷方式。花了我一段时间才能找到可以正常使用的键,大多数键在文本字段中无法正常工作。 I'm using the following: 我正在使用以下内容:
<keymap>
(aBuilder shortcut: #navigateFocusForwardCtrl)
category: #MorphFocusCtrlNavigation
default: $j ctrl asKeyCombination
do: [ :target :morph :event | morph navigateFocusForward ].
(aBuilder shortcut: #navigateFocusBackwardCtrl)
category: #MorphFocusCtrlNavigation
default: $k ctrl asKeyCombination
do: [ :target :morph :event | morph navigateFocusBackward ].
(aBuilder shortcut: #navigateVisibleWindowForward)
category: #MorphFocusCtrlNavigation
default: Character tab ctrl asKeyCombination
do: [ :target :morph :event | World navigateVisibleWindowForward ].
(aBuilder shortcut: #navigateWindowForward)
category: #MorphFocusCtrlNavigation
default: $l ctrl asKeyCombination
do: [ :target :morph :event | World navigateWindowForward ].
(aBuilder shortcut: #navigateWindowBackward)
category: #MorphFocusCtrlNavigation
default: $; ctrl asKeyCombination
do: [ :target :morph :event | World navigateWindowBackward ]
although the category probably isn't correct, it works... (whereas #MorphFocusNavigation doesn't!) 尽管类别可能不正确,但它可以工作...(而#MorphFocusNavigation则不正确!)
Using the hallo menu bring up an inspector on a window object. 使用hallo菜单可以在窗口对象上显示检查器。 Then in the inspector switch to the 'Keys' tab. 然后在检查器中切换到“键”选项卡。 There you can see all the shortcuts associated with the morph. 在那里,您可以看到与变形关联的所有快捷方式。 Selecting the one that you are interested in (Alt+TAB) will open a new inspector pane to the right. 选择您感兴趣的那个(Alt + TAB),将在右侧打开一个新的检查器窗格。 The 'Source code' shows and highlights the source code where the keybinding is defined. “源代码”显示并突出显示定义了绑定的源代码。 Browse the method, edit it, save it, reset the key mappings (KMRepository reset) and you should be done. 浏览该方法,对其进行编辑,保存,重置键映射(KMRepository重置),您应该已完成。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.