How do I to disable the f12 option to view the code?Confused

Get help using Construct 2

Post » Wed Mar 23, 2016 12:15 pm

Hi people,
I exported a Construct2 game with nw.js and when I run everything perfect ... but ...
when I press the F12 key I see the html code ...
I do not like a player accidentally press the f12 key and did not know what to do ...
I'm a little confuse ... :?
Is it possible to disable the f12 option to view the code before compiled .exe???

Thanks
B
12
S
1
Posts: 49
Reputation: 873

Post » Wed Mar 23, 2016 5:02 pm

on web,I found this Disable F12 Key in a Page
so you can test for nw.js..add Browser object and event
System -On Start of Layout.....Browser Execute Javascript

Code: Select all
"document.onkeypress = function (event) { 
event = (event || window.event); 
if (event.keyCode == 123) { 
return false;  }                                                           } 


document.onkeydown = function (event) { 
event = (event || window.event); 
if (event.keyCode == 123) { 
return false;  } 
                                                                                       }  "
B
67
S
24
G
7
Posts: 1,519
Reputation: 11,104

Post » Thu Mar 24, 2016 8:05 am

Thanks Korbaach for your time!
B
12
S
1
Posts: 49
Reputation: 873

Post » Thu Mar 24, 2016 10:43 am

Edited.... i was thinking your asking for the f12 option for canceling the developer console on browsers... now i seen the actual request ... my bad
Last edited by gamecorpstudio on Thu Mar 24, 2016 2:00 pm, edited 2 times in total.
B
86
S
26
G
75
Posts: 1,440
Reputation: 47,805

Post » Thu Mar 24, 2016 10:55 am

Just download the 'normal' version of nw.js and replace the files in the nwforc2 folder. C2 ships with the sdk version of nw.js so that you can use the debug functions, but the normal version does not contain the debug functions. Here's the link.
Learning other engines, but C2 still rocks. Image Image Image Image
B
80
S
22
G
95
Posts: 2,418
Reputation: 57,673

Post » Fri Mar 25, 2016 11:37 am

Ok! I I did not know this option. Thank you so much!
B
12
S
1
Posts: 49
Reputation: 873


Return to How do I....?

Who is online

Users browsing this forum: Ishify and 5 guests