Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | 93x 136x | import { IKeyMap } from '@zeedhi/core';
import { Component } from '../zd-component/component';
import { IDataNavigator, IKeyMapConfig, IViewNavigator } from './interfaces';
export class KeyMapNavigation implements IKeyMapConfig<IViewNavigator & IDataNavigator> {
getMap(instance: Component & IViewNavigator & IDataNavigator): IKeyMap {
return {
up: {
event: instance.navigateUp.bind(instance),
active: true,
index: 99,
repeat: true,
},
down: {
event: instance.navigateDown.bind(instance),
active: true,
index: 99,
repeat: true,
},
pageup: {
event: instance.navigatePageUp.bind(instance),
stop: true,
index: 99,
active: true,
},
pagedown: {
event: instance.navigatePageDown.bind(instance),
stop: true,
index: 99,
active: true,
},
left: {
event: instance.navigateLeft.bind(instance),
active: true,
index: 99,
repeat: true,
},
right: {
event: instance.navigateRight.bind(instance),
active: true,
index: 99,
repeat: true,
},
tab: {
event: instance.navigateRight.bind(instance),
prevent: false,
active: true,
index: 99,
input: true,
repeat: true,
},
'shift+tab': {
event: instance.navigateLeft.bind(instance),
prevent: false,
active: true,
index: 99,
input: true,
repeat: true,
},
enter: {
event: instance.navigateDown.bind(instance),
active: true,
index: 99,
input: true,
repeat: true,
},
'shift+enter': {
event: instance.navigateUp.bind(instance),
active: true,
index: 99,
input: true,
repeat: true,
},
};
}
}
|