Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
dilfich
Posts: 330 Joined: Thu Nov 30, 2017 1:17 am
Post
by dilfich » Mon Mar 30, 2020 12:51 pm
Hi!
How do I completely prohibit right-click on a document?
This does not help, only removes the context menu and the click on the page passes.
dilfich
Posts: 330 Joined: Thu Nov 30, 2017 1:17 am
Post
by dilfich » Tue Mar 31, 2020 8:49 am
All options via JavaScript disable only contextmenu and the click still passes, this is the first thing I tried.
RenderCompMsg
I've tried it too but it either doesn't work or I'm doing something wrong.
Disables the mouse completely.
Code: Select all
if (aMessage.Msg = WM_RBUTTONDOWN) then aHandled:= True;
The mouse still works, isn't it right?
salvadordf
Posts: 4016 Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:
Post
by salvadordf » Tue Mar 31, 2020 11:00 am
dilfich wrote: ↑ Tue Mar 31, 2020 8:49 am
Code: Select all
if (aMessage.Msg = WM_RBUTTONDOWN) then aHandled:= True;
The mouse still works, isn't it right?
That code should block the WM_RBUTTONDOWN messages only, leaving all other mouse messages pass through.
dilfich
Posts: 330 Joined: Thu Nov 30, 2017 1:17 am
Post
by dilfich » Tue Mar 31, 2020 11:11 am
Yes, it kind of works if you check it like this.
Code: Select all
document.addEventListener("mousedown", function(evt) {
console.log(evt.clientX+':'+evt.clientY +':'+ evt.buttons);
});
But this does not work on a real site and the site somehow registers that a click was made.