ExamVeda
Login
Home
1
When are the keyboard events fired?
Discuss
Answer & Solution
Answer: Option B
Solution:
The keydown and keyup events are fired when the user presses or releases a key on the keyboard. They are generated for modifier keys, function keys, and alphanumeric keys.
2
How does a user generate multiple keydown events?
Discuss
Answer & Solution
Answer: Option C
Solution:
If the user holds the key down long enough for it to begin repeating, there will be multiple keydown events before the keyup event arrives.
3
Which property is used to specify the key type when pressed?
Discuss
Answer & Solution
Answer: Option A
Solution:
The event object associated with these events has a numeric keyCode property that specifies which key was pressed.
4
What value does the keyCode property holds when a Shift key is pressed for adding punctuation character?
Discuss
Answer & Solution
Answer: Option D
Solution:
The number keys always generate keyCode values for the digit that appears on the key, even if you are holding down Shift in order to type a punctuation character.
5
Which of the following are not key event properties?
Discuss
Answer & Solution
Answer: Option A
Solution:
altKey, ctrlKeY, shiftKey, and metaKey are key event object’s properties, which are set to true if the corresponding modifier key is held down when the event occurs.
6
Which of the following key property holds the key name as a string?
Discuss
Answer & Solution
Answer: Option B
Solution:
The DOM Level 3 Events defines a new key property that contains the key name as a string.
7
Which of the following is not the value the key property will hold if the key is a function key?
Discuss
Answer & Solution
Answer: Option A
Solution:
If the key is a function key, the key property will be a value like “F2”, “Home”, or “Left”.
8
Which method is used to add a binding?
Discuss
Answer & Solution
Answer: Option C
Solution:
To add a binding, use bind() method.
9
Which method is used to remove a binding?
Discuss
Answer & Solution
Answer: Option D
Solution:
To remove a bind, use unbind() method.
10
Which of the following are the parameters passed to the keymap after installation?
Discuss
Answer & Solution
Answer: Option C
Solution:
After the keymap is installed, the following parameters are passed:
1. The event object for the keydown event.
2. The key identifier of the key that was pressed.