Using chromedp, I want to send ctrl+alt+delete to a specific browser tab as the remote system is windows-based. I want to avoid having to type my password which is quite long.
The latest incarnation I tried was this:
chromedp.Run(ctx,
input.DispatchKeyEvent(input.KeyDown).WithKey(kb.Control),
chromedp.Sleep(200*time.Millisecond),input.DispatchKeyEvent(input.KeyDown).WithKey(kb.Alt),
chromedp.Sleep(200*time.Millisecond),input.DispatchKeyEvent(input.KeyDown).WithKey(kb.Delete))
Prior to that, I attempted this:
chromedp.KeyEvent(kb.Control),
chromedp.KeyEvent(kb.Alt),
chromedp.KeyEvent(kb.Delete))
I also tried using the key modifiers where the Key Event was just a delete, but that didn’t work either.
I setup a key listener in the browser and ctrl+alt+delete is not captured yet it does work to lock and unlock the system.
document.onkeypress = function (e) {
e = e || window.event;
console.log(e.keyCode);
};
I also used this to capture meta keys:
document.addEventListener(‘keydown’, (event) => {
console.log(‘Meta key pressed:’, event.metaKey);
console.log(‘Alt key pressed:’, event.altKey);
console.log(‘Control key pressed:’, event.ctrlKey);
console.log(‘Shift key pressed:’, event.shiftKey);
});
If I tap delete by itself, then I get the keycode, but that is the only key that prints to the console log.
Is this possible?