【问题标题】:adding arrow keys to ngx-material-keyboard向 ngx-material-keyboard 添加箭头键
【发布时间】:2020-12-24 04:30:21
【问题描述】:

我正在使用 ngx-material-keyboard/core,我需要像这样在标准键盘的右侧添加箭头键:

我正在查看这里的文档: https://github.com/joskwanten/core#providing-custom-layouts

我不清楚如何实现这一点。这是我到目前为止所尝试的:

export const customTextKeyPadLayouts: IKeyboardLayouts = {
...keyboardLayouts,
'Notes Layout': {
  name: 'Protocol Notes layout',
  keys: [
    [['`'], ['1'], ['2'], ['3'], ['4'], ['5'], ['6'], ['7'], ['8'], ['9'], ['0'], [KeyboardClassKey.Bksp], [''], ['^']],
    [['Q'], ['W'], ['E'], ['R'], ['T'], ['Y'], ['U'], ['I'], ['O'], ['P'], ['['], [']'], ['\'']],
    [['A'], ['S'], ['D'], ['F'], ['H'], ['J'], ['K'], ['L'], [';'], [',']],
    [['Z'], ['X'], ['C'], ['V'], ['B'], ['N'], ['M'], [','], ['.']],
    [[KeyboardClassKey.Space]]
  ],
  lang: ['protocol-notes-text']
},
};```

在keys 数组的第一行你可以看到我添加了: , [''], ['^']],

试图模拟向上箭头,但显然这不会导致向上移动光标的预期行为,而是插入一个插入符号 (^)。有什么方法可以使用默认布局添加箭头控制字段?

上面提到的KeyboardClassKey只有有限的字符,没有可用的箭头。

【问题讨论】:

    标签: angular angular-material


    【解决方案1】:

    查看项目的GitHubrepository中的源码,你想要实现的东西是不可能的,除非你想fork项目并在keyboard-key.component.ts中处理方向键。

    或寻找其他替代品,例如this one。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-07
      • 1970-01-01
      • 2011-05-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多