Sciencemadness Discussion Board
Not logged in [Login ]
Go To Bottom

Printable Version  
Author: Subject: Any _javascript gurus here? Website help.
Neal
Hazard to Others
***




Posts: 143
Registered: 24-12-2021
Location: Chicago, IL, USA.
Member Is Online


[*] posted on 30-11-2022 at 18:41
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]
View user's profile View All Posts By User
Neal
Hazard to Others
***




Posts: 143
Registered: 24-12-2021
Location: Chicago, IL, USA.
Member Is Online


[*] posted on 30-11-2022 at 18:42


JavaScript*

Weird, I tried to edit the title to capital J, and it makes it to _j. Forum bug?
View user's profile View All Posts By User
Neal
Hazard to Others
***




Posts: 143
Registered: 24-12-2021
Location: Chicago, IL, USA.
Member Is Online


[*] posted on 1-12-2022 at 05:02


Nevermind, got it to work.
View user's profile View All Posts By User
SuperOxide
Hazard to Others
***




Posts: 486
Registered: 24-7-2019
Location: Devils Anus
Member Is Offline


[*] posted on 16-12-2022 at 23:04


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).
View user's profile View All Posts By User
khlor
Hazard to Self
**




Posts: 95
Registered: 4-1-2014
Location: Who knows, really...
Member Is Offline

Mood: No Mood

[*] posted on 25-12-2022 at 09:49


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!"
View user's profile View All Posts By User This user has MSN Messenger
SuperOxide
Hazard to Others
***




Posts: 486
Registered: 24-7-2019
Location: Devils Anus
Member Is Offline


[*] posted on 26-12-2022 at 13:54


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]
View user's profile View All Posts By User
khlor
Hazard to Self
**




Posts: 95
Registered: 4-1-2014
Location: Who knows, really...
Member Is Offline

Mood: No Mood

[*] posted on 28-12-2022 at 09:34


Maybe you need to check system specific keybindings or maybe, system specific event listener limitations.



"NOOOOOO!!! The mixture is all WROOOOOOONG!"
View user's profile View All Posts By User This user has MSN Messenger
Raid
Hazard to Everyone
***




Posts: 202
Registered: 14-11-2022
Location: N/A
Member Is Offline

Mood: School

[*] posted on 18-1-2023 at 05:30


i know a bit of JS, mostly just using it for web-based cheats ;)
View user's profile View All Posts By User

  Go To Top