Home Web Front-end JS Tutorial Native js realizes the acquisition of shift/ctrl/alt keys_javascript skills

Native js realizes the acquisition of shift/ctrl/alt keys_javascript skills

May 16, 2016 pm 05:37 PM
alt ctrl shift button

Copy code The code is as follows:

document.onclick = function(e){
alert(getKey (e));
};
function getKey(e){
var e = e || window.event;
var keys = [];

if(e .shiftKey){
keys.push("shift key");
};
if(e.ctrlKey){
keys.push("ctrl key");
};
if(e.altKey){
keys.push("alt key");
};
return keys;
};
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What should I do if I can't switch between Chinese and English by pressing shift? What should I do if I can't switch between Chinese and English by pressing shift? Feb 22, 2023 pm 04:13 PM

Solution to the problem that pressing shift cannot switch between Chinese and English: 1. Find the win key and click to open; 2. Find "Settings" and click to open, then open "Time and Language"; 3. Click "Region and Language" and open "Options" "; 4. Click "Options" and then select "shift" in the first line.

What does the ctrl+a key mean? What does the ctrl+a key mean? Mar 16, 2023 pm 03:12 PM

The ctrl+a key means "select all" and is the most common shortcut key in computers. Common keyboard shortcuts include Ctrl+B (organize favorites), Ctrl+C (copy), Ctrl+D ( Delete), Ctrl+E (Search Assistant), Ctrl+V (Paste), etc.

What is the shortcut key for alt+=? What is the shortcut key for alt+=? Mar 10, 2023 am 11:40 AM

alt+= is a shortcut key for quick summing. The method of using the "alt+=" shortcut key is: 1. Open the Excel table file; 2. Create numerical data; 3. Use the mouse to select the data to be summed; 4. Press "alt+=" ” key to sum the selected data.

Which key is on l? Which key is on l? Jun 21, 2023 am 11:31 AM

Above l is the shift on the left side of the keyboard. The l here means left, which is opposite to r.

How to turn off the back key vibration function of Redmi K40 Pro? Return key setting guide How to turn off the back key vibration function of Redmi K40 Pro? Return key setting guide Jan 09, 2024 am 09:58 AM

Many friends don’t like the function of key vibration on mobile phones, mainly because it is not practical and relatively speaking, it also consumes more power. Today I will bring you how to turn off the key vibration of Redmi K40Pro, as well as a tutorial on how to set up the return button on Redmi phones. For how to turn off key vibration on Redmi K40Pro, you can follow the steps below: 1. Open the settings menu of your phone. 2. In the settings menu, find the "Sounds & Vibration" option. 3. In the "Sounds and Vibration" options, find the "Key Vibration" setting. 4. Click on the "Key Vibration" setting and then turn off this function. For the settings of the return key on Redmi phones, you can follow the steps below: 1. Open the settings menu of the phone. 2. in

How to add/remove security options from CTRL+ALT+DEL screen How to add/remove security options from CTRL+ALT+DEL screen Apr 26, 2023 pm 12:07 PM

Having the ability to customize allows one to explore more. Windows offers its users the greatest amount of customization, and we are all very grateful. So, have you ever considered customizing your CTRL+ALT+DEL screen? Of course you have, otherwise you wouldn’t be reading this article right now. Well, we have good news for you! You do have the ability to customize the security options screen. You can keep only the options you want and delete all the ones you don't need. CTRL+ALT+DEL screen customization can be done through the Local Group Policy Editor or the Registry Editor. You can choose the method of your choice, both have the same effect. So, what are you waiting for, let’s dive into the article! Hope you like it! Method 1: Edit through local group policy

How to solve the problem of typing after pressing the Shift key to make the game play smoothly on Win11 How to solve the problem of typing after pressing the Shift key to make the game play smoothly on Win11 Dec 24, 2023 am 10:33 AM

I believe that many friends who play games have encountered the problem of typing when pressing shift. This is because the system’s default input method switching key is shift, so we can solve this problem by modifying the keys. Let’s follow the editor’s instructions. Get up and try it. When playing games in win11, you can type by pressing shift: The first step is to open the settings by pressing "Win" + "i" on the keyboard. The second step is to click "Time and Language" on the left column. The third step is to enter the "Input" settings on the right side. The fourth step is to open the "Advanced Keyboard Settings". The fifth step is to click the "Input Language Hotkey" button under Switch Input Method. Step 6. Click "Change Key Sequence" in the pop-up window. Step 7. Change the switching input language to "Unassigned" and confirm to save.

What does ctrl+spacebar do? What does ctrl+spacebar do? Mar 09, 2023 pm 04:18 PM

The function of "ctrl+spacebar" is to switch between Chinese and English input methods; through "ctrl+spacebar" you can switch back and forth between Chinese and English input methods; "ctrl" is a commonly used key on the keyboard, and its full name is "control". In computer basics they are called "control keys".

See all articles