Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Learn More

Screwed keyup events with alt modifiers

  • 11 trả lời
  • 1 gặp vấn đề này
  • 22 lượt xem
  • Trả lời mới nhất được viết bởi cor-el

more options

Hi,

I think I broke the ALT keyup events in some way, probably with my configuration but not sure how.

If I put this code in the console : `document.addEventListener("keyup", e=>console.log('alt: '+e.altKey+' | '+String.fromCharCode(e.which).toLowerCase()));` and the press the keys, I have the following results:

- pressing "I", I get the expected "alt: false | i" - pressing "ALT+I", I get "alt: true | �"

I do not have the problem with other modifier keys like CTRL

Đính kèm ảnh chụp màn hình

Giải pháp được chọn

Does it make a difference which Alt key you use (left or right)?

This may also be a problem with your keyboard layout that uses the Alt key as a modifier at the OS level, so Firefox gets a different character.

I notice that with "Resist Fingerprinting" enabled I get always e.altKey = false

Đọc câu trả lời này trong ngữ cảnh 👍 0

Tất cả các câu trả lời (11)

more options

OS X 10.15.7, FF 86.0.1

Hữu ích?

more options

It's not a Firefox issue.

Hữu ích?

more options

How to be sure it's not a Firefox issue? I agree it's probably due to my instance (extensions or configuration messing something up), but if it's not a Firefox issue, how come can't I reproduce it on the other navigators installed on my system? How do I tackle it?

Hữu ích?

more options

For the record, I already tried disabling all extensions, and it didn't solve anything.

Hữu ích?

more options

Simon said

How to be sure it's not a Firefox issue?

I can reproduce it on Edge/Chromium on Windows.

Hữu ích?

more options

Well according to the docs `which` `code` and `keyCode` value should not depend on the modifier key, hence my confusion. I'm surprised the you can reproduce, this should not be the normal behavior.

I filed a bug although I'm pretty sure it comes from my config as my colleague is not having the problemn with the same FF version and OS.

Hữu ích?

more options

OK, thanks for filing a bug. Let's see what devs say.

Hữu ích?

more options

Giải pháp được chọn

Does it make a difference which Alt key you use (left or right)?

This may also be a problem with your keyboard layout that uses the Alt key as a modifier at the OS level, so Firefox gets a different character.

I notice that with "Resist Fingerprinting" enabled I get always e.altKey = false

Hữu ích?

more options

Oh my god thank you it's been a challenging two weeks ^^

I know I had changed some privacy params but couldn't find the right one....

So I do get altKey=true, but the wrong code / keyCode etc. Gonna notify the devs thank you again

Hữu ích?

more options

(Just to clarify, it was indeed the "Resist Fingerprinting" param)

Hữu ích?

more options

You're welcome

I tested that because of your Firefox 78 user agent, that could be an indication of using "Resist Fingerprinting".

Hữu ích?

Đặt một câu hỏi

Bạn phải đăng nhập vào tài khoản của bạn để trả lời bài viết. Vui lòng bắt đầu một câu hỏi mới, nếu bạn chưa có tài khoản.