Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
interface IKeyboardableComponentState {
lastKeyDown: string | null;
lastKeyUp: string | null;
lastKeyDownCapture: string | null;
lastKeyUpCapture: string | null;
lastKeyDownCode: string | null;
lastKeyUpCode: string | null;
lastKeyDownCaptureCode: string | null;
lastKeyUpCaptureCode: string | null;
}
const handledNativeKeyboardEvents: IHandledKeyboardEvent[] = [
{code: 'KeyA', handledEventPhase: HandledEventPhase.Capturing},
{code: 'KeyB'},
{code: 'Digit1', handledEventPhase: HandledEventPhase.Bubbling},
{code: 'Tab', handledEventPhase: HandledEventPhase.Capturing},
];
class ViewWindowsKeyboardExample extends React.Component<
{},
IKeyboardableComponentState
> {
public constructor(props: {}) {
super(props);
this.state = {
lastKeyDown: null,
lastKeyUp: null,
lastKeyDownCapture: null,
lastKeyUpCapture: null,
lastKeyDownCode: null,
lastKeyUpCode: null,
lastKeyDownCaptureCode: null,
blackbox: {height: 30, width: 30, borderColor: 'black', borderWidth: 3},
});
interface IKeyboardableComponentState {
lastKeyDown: string | null;
lastKeyUp: string | null;
lastKeyDownCapture: string | null;
lastKeyUpCapture: string | null;
lastKeyDownCode: string | null;
lastKeyUpCode: string | null;
lastKeyDownCaptureCode: string | null;
lastKeyUpCaptureCode: string | null;
}
const handledNativeKeyboardEvents: IHandledKeyboardEvent[] = [
{code: 'KeyA', handledEventPhase: HandledEventPhase.Capturing},
{code: 'KeyB'},
{code: 'Digit1', handledEventPhase: HandledEventPhase.Bubbling},
{code: 'Tab', handledEventPhase: HandledEventPhase.Capturing},
];
class ViewWindowsKeyboardExample extends React.Component<
{},
IKeyboardableComponentState
> {
public constructor(props: {}) {
super(props);
this.state = {
lastKeyDown: null,
lastKeyUp: null,
lastKeyDownCapture: null,
lastKeyUpCapture: null,