'整合命令框

pull/7/head
zoe 7 years ago
parent 43e2ad5e2a
commit 1302a20ece

@ -130,7 +130,9 @@ export default class InputHint extends React.Component<{ commandStore?: CommandS
//绑定键盘命令
public handleSelectCommand = (e: KeyboardEvent) =>
{
// (this.props.commandStore.elInput as HTMLInputElement).focus();
// if (document.activeElement.nodeName !== 'INPUT')
// (this.props.commandStore.elInput as HTMLInputElement).focus();
let m_li: HTMLCollection = this.m_recommendUl.children;;
let historyCommands = this.state.historyCommands;
@ -459,10 +461,9 @@ export default class InputHint extends React.Component<{ commandStore?: CommandS
type="text"
placeholder="请输入命令"
ref={o => { this.props.commandStore.elInput = o; }}
// onKeyPress={this.handleConfirmInput}
onKeyDown={e => { e.preventDefault() }}
// onKeyDown={e => { e.preventDefault() }}
onChange={this.handleOnChange}
// value={this.state.command}
value={this.state.command}
/>
<ul
className="history-command"

@ -18,14 +18,15 @@ export class CommandStore
{
xaop.begin(ed.m_KeyCtrl, KeyBoardControls.prototype.OnKeyDown, (e: KeyboardEvent) =>
{
if (IsNumble(e.keyCode) || IsChar(e.keyCode))
{
this.elInput.value += e.key;
}
else
{
this.keyDownHandle(e.keyCode);
}
this.elInput.focus();
// if (IsNumble(e.keyCode) || IsChar(e.keyCode))
// {
// // this.elInput.value += e.key;
// }
// else
// {
// this.keyDownHandle(e.keyCode);
// }
});
}
@observable commands: Array<CommandMsg> = [];

Loading…
Cancel
Save