Fixed #3602 - Keyboard support: Numpad enter

pull/4987/head
mertsincan 2023-12-20 10:45:43 +00:00
parent f887f97879
commit e0de315cfc
38 changed files with 45 additions and 14 deletions

View File

@ -144,6 +144,7 @@ export default {
break; break;
case 'Enter': case 'Enter':
case 'NumpadEnter':
case 'Space': case 'Space':
this.onTabEnterKey(event, tab, index); this.onTabEnterKey(event, tab, index);
break; break;

View File

@ -2185,6 +2185,7 @@ export default {
} }
case 'Enter': case 'Enter':
case 'NumpadEnter':
case 'Space': { case 'Space': {
this.onDateSelect(event, date); this.onDateSelect(event, date);
@ -2361,6 +2362,7 @@ export default {
} }
case 'Enter': case 'Enter':
case 'NumpadEnter':
case 'Space': { case 'Space': {
this.onMonthSelect(event, index); this.onMonthSelect(event, index);
@ -2454,6 +2456,7 @@ export default {
} }
case 'Enter': case 'Enter':
case 'NumpadEnter':
case 'Space': { case 'Space': {
this.onYearSelect(event, index); this.onYearSelect(event, index);

View File

@ -243,6 +243,7 @@ export default {
break; break;
case 'Enter': case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event); this.onEnterKey(event);
break; break;

View File

@ -110,6 +110,7 @@ export default {
break; break;
case 'Enter': case 'Enter':
case 'NumpadEnter':
if (inputValue && inputValue.trim().length && !this.maxedOut) { if (inputValue && inputValue.trim().length && !this.maxedOut) {
this.addItem(event, inputValue, true); this.addItem(event, inputValue, true);
} }

View File

@ -152,14 +152,14 @@ export default {
this.visible = false; this.visible = false;
}, },
onAcceptKeydown(event) { onAcceptKeydown(event) {
if (event.code === 'Space' || event.code === 'Enter') { if (event.code === 'Space' || event.code === 'Enter' || event.code === 'NumpadEnter') {
this.accept(); this.accept();
DomHandler.focus(this.target); DomHandler.focus(this.target);
event.preventDefault(); event.preventDefault();
} }
}, },
onRejectKeydown(event) { onRejectKeydown(event) {
if (event.code === 'Space' || event.code === 'Enter') { if (event.code === 'Space' || event.code === 'Enter' || event.code === 'NumpadEnter') {
this.reject(); this.reject();
DomHandler.focus(this.target); DomHandler.focus(this.target);
event.preventDefault(); event.preventDefault();

View File

@ -181,6 +181,7 @@ export default {
break; break;
case 'Enter': case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event); this.onEnterKey(event);
break; break;

View File

@ -402,6 +402,7 @@ export default {
onToggleButtonKeyDown(event) { onToggleButtonKeyDown(event) {
switch (event.code) { switch (event.code) {
case 'Enter': case 'Enter':
case 'NumpadEnter':
case 'Space': case 'Space':
this.toggleMenu(event); this.toggleMenu(event);

View File

@ -839,6 +839,7 @@ export default {
break; break;
case 'Enter': case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event, rowData, rowIndex); this.onEnterKey(event, rowData, rowIndex);
break; break;

View File

@ -228,7 +228,7 @@ export default {
this.$emit('column-click', { originalEvent: event, column: this.column }); this.$emit('column-click', { originalEvent: event, column: this.column });
}, },
onKeyDown(event) { onKeyDown(event) {
if ((event.code === 'Enter' || event.code === 'Space') && event.currentTarget.nodeName === 'TH' && DomHandler.getAttribute(event.currentTarget, 'data-p-sortable-column')) { if ((event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') && event.currentTarget.nodeName === 'TH' && DomHandler.getAttribute(event.currentTarget, 'data-p-sortable-column')) {
this.$emit('column-click', { originalEvent: event, column: this.column }); this.$emit('column-click', { originalEvent: event, column: this.column });
event.preventDefault(); event.preventDefault();
} }

View File

@ -197,6 +197,7 @@ export default {
} }
case 'Enter': case 'Enter':
case 'NumpadEnter':
case 'Space': { case 'Space': {
this.onSpaceKey(event); this.onSpaceKey(event);

View File

@ -473,6 +473,7 @@ export default {
break; break;
case 'Enter': case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event); this.onEnterKey(event);
break; break;

View File

@ -66,7 +66,7 @@ export default {
}); });
}, },
onKeyDown(event) { onKeyDown(event) {
if (event.code === 'Enter' || event.code === 'Space') { if (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') {
this.toggle(event); this.toggle(event);
event.preventDefault(); event.preventDefault();
} }

View File

@ -149,6 +149,7 @@ export default {
onIndicatorKeyDown(event, index) { onIndicatorKeyDown(event, index) {
switch (event.code) { switch (event.code) {
case 'Enter': case 'Enter':
case 'NumpadEnter':
case 'Space': case 'Space':
this.stopSlideShow(); this.stopSlideShow();

View File

@ -298,7 +298,7 @@ export default {
} }
}, },
onThumbnailKeydown(event, index) { onThumbnailKeydown(event, index) {
if (event.code === 'Enter' || event.code === 'Space') { if (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') {
this.onItemClick(index); this.onItemClick(index);
event.preventDefault(); event.preventDefault();
} }

View File

@ -266,6 +266,7 @@ export default {
break; break;
case 'Enter': case 'Enter':
case 'NumpadEnter':
case 'Space': case 'Space':
this.onSpaceKey(event); this.onSpaceKey(event);
break; break;
@ -414,6 +415,7 @@ export default {
break; break;
case 'Enter': case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event); this.onEnterKey(event);
break; break;

View File

@ -223,6 +223,7 @@ export default {
break; break;
case 'Enter': case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event); this.onEnterKey(event);
break; break;
@ -300,7 +301,7 @@ export default {
this.toggle(event); this.toggle(event);
}, },
menuButtonKeydown(event) { menuButtonKeydown(event) {
(event.code === 'Enter' || event.code === 'Space') && this.menuButtonClick(event); (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') && this.menuButtonClick(event);
}, },
onArrowDownKey(event) { onArrowDownKey(event) {
if (this.horizontal) { if (this.horizontal) {

View File

@ -152,6 +152,7 @@ export default {
break; break;
case 'Enter': case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event); this.onEnterKey(event);
break; break;

View File

@ -211,6 +211,7 @@ export default {
break; break;
case 'Enter': case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event); this.onEnterKey(event);
break; break;
@ -292,7 +293,7 @@ export default {
this.toggle(event); this.toggle(event);
}, },
menuButtonKeydown(event) { menuButtonKeydown(event) {
(event.code === 'Enter' || event.code === 'Space') && this.menuButtonClick(event); (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') && this.menuButtonClick(event);
}, },
onArrowDownKey(event) { onArrowDownKey(event) {
const processedItem = this.visibleItems[this.focusedItemInfo.index]; const processedItem = this.visibleItems[this.focusedItemInfo.index];

View File

@ -379,6 +379,7 @@ export default {
break; break;
case 'Enter': case 'Enter':
case 'NumpadEnter':
case 'Space': case 'Space':
this.onEnterKey(event); this.onEnterKey(event);
break; break;
@ -511,6 +512,7 @@ export default {
break; break;
case 'Enter': case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event); this.onEnterKey(event);
break; break;

View File

@ -176,6 +176,7 @@ export default {
break; break;
case 'Enter': case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event); this.onEnterKey(event);
break; break;

View File

@ -125,7 +125,7 @@ export default {
this.$emit('node-toggle', node); this.$emit('node-toggle', node);
}, },
onKeydown(event) { onKeydown(event) {
if (event.code === 'Enter' || event.code === 'Space') { if (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') {
this.toggleNode(); this.toggleNode();
event.preventDefault(); event.preventDefault();
} }

View File

@ -70,7 +70,7 @@ export default {
}); });
}, },
onKeyDown(event) { onKeyDown(event) {
if (event.code === 'Enter' || event.code === 'Space') { if (event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') {
this.toggle(event); this.toggle(event);
event.preventDefault(); event.preventDefault();
} }

View File

@ -153,6 +153,7 @@ export default {
break; break;
case 'Enter': case 'Enter':
case 'NumpadEnter':
case 'Space': case 'Space':
this.onHeaderEnterKey(event, item); this.onHeaderEnterKey(event, item);
break; break;

View File

@ -126,6 +126,7 @@ export default {
break; break;
case 'Enter': case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event); this.onEnterKey(event);
break; break;

View File

@ -642,6 +642,7 @@ export default {
break; break;
case 'Enter': case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event, listType); this.onEnterKey(event, listType);
break; break;

View File

@ -197,6 +197,7 @@ export default {
break; break;
case 'Enter': case 'Enter':
case 'NumpadEnter':
case 'Space': case 'Space':
this.onEnterKey(event); this.onEnterKey(event);
break; break;

View File

@ -115,6 +115,7 @@ export default {
break; break;
case 'Enter': case 'Enter':
case 'NumpadEnter':
case 'Space': { case 'Space': {
this.onItemClick(event, item); this.onItemClick(event, item);

View File

@ -121,6 +121,7 @@ export default {
} }
case 'Space': case 'Space':
case 'NumpadEnter':
case 'Enter': { case 'Enter': {
this.onItemClick(event, item, index); this.onItemClick(event, item, index);

View File

@ -220,6 +220,7 @@ export default {
break; break;
case 'Enter': case 'Enter':
case 'NumpadEnter':
case 'Space': case 'Space':
this.onTabEnterKey(event, tab, index); this.onTabEnterKey(event, tab, index);
break; break;

View File

@ -43,7 +43,7 @@ export default {
this.$refs.input.focus(); this.$refs.input.focus();
}, },
onKeydown(event) { onKeydown(event) {
if (event.code === 'Enter' && this.commandText) { if ((event.code === 'Enter' || event.code === 'NumpadEnter') && this.commandText) {
this.commands.push({ text: this.commandText }); this.commands.push({ text: this.commandText });
TerminalService.emit('command', this.commandText); TerminalService.emit('command', this.commandText);
this.commandText = ''; this.commandText = '';

View File

@ -205,6 +205,7 @@ export default {
break; break;
case 'Enter': case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event); this.onEnterKey(event);
break; break;

View File

@ -164,7 +164,7 @@ export default {
return node.leaf === false ? false : !(node.children && node.children.length); return node.leaf === false ? false : !(node.children && node.children.length);
}, },
onFilterKeydown(event) { onFilterKeydown(event) {
if (event.code === 'Enter') { if (event.code === 'Enter' || event.code === 'NumpadEnter') {
event.preventDefault(); event.preventDefault();
} }

View File

@ -185,6 +185,7 @@ export default {
break; break;
case 'Enter': case 'Enter':
case 'NumpadEnter':
case 'Space': case 'Space':
this.onEnterKey(event); this.onEnterKey(event);

View File

@ -230,6 +230,7 @@ export default {
case 'Space': case 'Space':
case 'Enter': case 'Enter':
case 'NumpadEnter':
this.onEnterKey(event); this.onEnterKey(event);
break; break;

View File

@ -148,7 +148,7 @@ export default {
this.$emit('column-click', { originalEvent: event, column: this.column }); this.$emit('column-click', { originalEvent: event, column: this.column });
}, },
onKeyDown(event) { onKeyDown(event) {
if ((event.code === 'Enter' || event.code === 'Space') && event.currentTarget.nodeName === 'TH' && DomHandler.getAttribute(event.currentTarget, 'data-p-sortable-column')) { if ((event.code === 'Enter' || event.code === 'NumpadEnter' || event.code === 'Space') && event.currentTarget.nodeName === 'TH' && DomHandler.getAttribute(event.currentTarget, 'data-p-sortable-column')) {
this.$emit('column-click', { originalEvent: event, column: this.column }); this.$emit('column-click', { originalEvent: event, column: this.column });
event.preventDefault(); event.preventDefault();

View File

@ -718,7 +718,7 @@ export default {
} }
}, },
onColumnKeyDown(event, col) { onColumnKeyDown(event, col) {
if (event.code === 'Enter' && event.currentTarget.nodeName === 'TH' && DomHandler.getAttribute(event.currentTarget, 'data-p-sortable-column')) { if ((event.code === 'Enter' || event.code === 'NumpadEnter') && event.currentTarget.nodeName === 'TH' && DomHandler.getAttribute(event.currentTarget, 'data-p-sortable-column')) {
this.onColumnHeaderClick(event, col); this.onColumnHeaderClick(event, col);
} }
}, },

View File

@ -185,6 +185,7 @@ export default {
break; break;
case 'Enter': case 'Enter':
case 'NumpadEnter':
case 'Space': case 'Space':
if (!DomHandler.isClickable(event.target)) { if (!DomHandler.isClickable(event.target)) {
this.onEnterKey(event, item); this.onEnterKey(event, item);

View File

@ -83,7 +83,7 @@ export default {
this.$refs.input.focus(); this.$refs.input.focus();
}, },
onKeyDown(event) { onKeyDown(event) {
if (event.code === 'Enter') { if (event.code === 'Enter' || event.code === 'NumpadEnter') {
this.updateModel(); this.updateModel();
this.$emit('keydown', event); this.$emit('keydown', event);
event.preventDefault(); event.preventDefault();