Neal
Hazard to Others
Posts: 143
Registered: 24-12-2021
Location: Chicago, IL, USA.
Member Is Offline
|
|
Any _javascript gurus here? Website help.
I want to make the site popup a dialog like "Hello world!" when a user presses the PrintScreen button when on your site. Actually, just a popup that
says "You have pressed the PrintScreen button."
I would prefer if it could be done without a batch file? Is that possible?
[Edited on 1-12-2022 by Neal]
|
|
Neal
Hazard to Others
Posts: 143
Registered: 24-12-2021
Location: Chicago, IL, USA.
Member Is Offline
|
|
JavaScript*
Weird, I tried to edit the title to capital J, and it makes it to _j. Forum bug?
|
|
Neal
Hazard to Others
Posts: 143
Registered: 24-12-2021
Location: Chicago, IL, USA.
Member Is Offline
|
|
Nevermind, got it to work.
|
|
SuperOxide
Hazard to Others
Posts: 486
Registered: 24-7-2019
Location: Devils Anus
Member Is Offline
|
|
Neal, I'm a senior JS developer, so I'm rather curious how you got this to work because I've always thought that the browser can't detect things like
if a user hits the PrtSc/Print Screen key.
P.S. I'm assuming when you say print screen, you mean the screen capture, instead of printing the page (which you can detect using things like the
beforeprint event).
|
|
khlor
Hazard to Self
Posts: 95
Registered: 4-1-2014
Location: Who knows, really...
Member Is Offline
Mood: No Mood
|
|
Quote: Originally posted by SuperOxide | Neal, I'm a senior JS developer, so I'm rather curious how you got this to work because I've always thought that the browser can't detect things like
if a user hits the PrtSc/Print Screen key.
P.S. I'm assuming when you say print screen, you mean the screen capture, instead of printing the page (which you can detect using things like the
beforeprint event). |
I think that instead of the event, he is tracking/listenning to keypresses, that is far easier to do, and is supported by virtually any moder JS
capable browser.
Edit 1: text correction.
[Edited on 25-12-2022 by khlor]
"NOOOOOO!!! The mixture is all WROOOOOOONG!"
|
|
SuperOxide
Hazard to Others
Posts: 486
Registered: 24-7-2019
Location: Devils Anus
Member Is Offline
|
|
Quote: Originally posted by khlor | Quote: Originally posted by SuperOxide | Neal, I'm a senior JS developer, so I'm rather curious how you got this to work because I've always thought that the browser can't detect things like
if a user hits the PrtSc/Print Screen key.
P.S. I'm assuming when you say print screen, you mean the screen capture, instead of printing the page (which you can detect using things like the
beforeprint event). |
I think that instead of the event, he is tracking/listenning to keypresses, that is far easier to do, and is supported by virtually any moder JS
capable browser.
Edit 1: text correction.
[Edited on 25-12-2022 by khlor] |
I thought about that, but I don't think that would work either.
https://stackoverflow.com/questions/54744316/keypress-event-...
Edit: I see there's an accepted solution there. But I can't test it very well. I'm on a mac (and it didn't work, but maybe windows it will)
[Edited on 26-12-2022 by SuperOxide]
|
|
khlor
Hazard to Self
Posts: 95
Registered: 4-1-2014
Location: Who knows, really...
Member Is Offline
Mood: No Mood
|
|
Maybe you need to check system specific keybindings or maybe, system specific event listener limitations.
"NOOOOOO!!! The mixture is all WROOOOOOONG!"
|
|
Raid
Hazard to Everyone
Posts: 202
Registered: 14-11-2022
Location: N/A
Member Is Offline
Mood: School
|
|
i know a bit of JS, mostly just using it for web-based cheats
|
|