小编mer*_*ere的帖子

Python tkinter(复制/粘贴不适用于其他语言)

我发现每当我将语言从英语切换到俄语时,tkinter 就会停止对Ctrl+ CCtrl+VCtrl+做出反应X

\n\n

当我切换回英语时它仍然有效,即使文本是俄语的。

\n\n

我尝试了在堆栈交换上可以找到的与复制粘贴主题远程相关的所有代码片段,添加了类似于原始代码的内容,例如self.bind(\'<Control-\xd0\xbc>\', self.paste)(“\xd0\xbc”在俄语中与英语中的“v”按钮相同),但仍然没有任何结果作品。

\n\n

非常感谢有关如何修复它的任何帮助/想法。

\n

python keyboard-shortcuts copy-paste tkinter keyboard-events

3
推荐指数
2
解决办法
3200
查看次数

确保对象将每个枚举值作为键(Typescript)?

我希望打字稿在对象没有每个枚举值作为键时抛出错误。是否可以?

type EnumMap<T> = { ??? }

enum Colors {
    Red = 'Red',
    Blue = 'Blue'
}

const obj1: EnumMap<Colors> = {
  [Colors.Red]: 'roses',
  [Colors.Blue]: 'violets'
} // works fine

const obj2: EnumMap<Colors> = {
  [Colors.Red]: 'roses'
} // should throw error since Colors.Blue is not among obj2 keys

Run Code Online (Sandbox Code Playgroud)

typescript typescript-typings

3
推荐指数
1
解决办法
970
查看次数