Skip to content

Windows Print Screen #615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 of 3 tasks
jweingarten-rv opened this issue Apr 14, 2025 · 1 comment
Open
2 of 3 tasks

Windows Print Screen #615

jweingarten-rv opened this issue Apr 14, 2025 · 1 comment

Comments

@jweingarten-rv
Copy link

Short summary
How do I make the Windows 11 PrintScreen keyboard shortcut work to take a screenshot?

Desired execution environment / tested on

  • Virtual machine
  • Docker container
  • Dev/Host system

node version:
v.22.13.0

OS type and version:
Windows

Full code sample related to question

  1. Execute the below code
'use strict';

const {keyboard, Key, } = require("@nut-tree/nut-js");



const main = async () => {
    
   await keyboard.type(Key.LeftSuper, Key.Print);

};



main();
  1. Try to paste into Microsoft Paint.
    Nothing seems to be in the Clipboard at this point.

Detailed question

Not sure what I am doing wrong, but I tried all kinds of combinations of LeftWin or LeftSuper with Print or even just Print and I don't seem to get a screenshot either saved to disk or clipboard.

My goal in the test on Windows is to

  • take a screenshot of the current screen
  • paste the screenshot, that is in the clipboard now, into my application under test
@s1hofmann
Copy link
Member

Hi @jweingarten-rv 👋

I’ll have a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants