Add missing JSDocs
This commit is contained in:
@@ -211,6 +211,11 @@ function applyShellStylesheet(stylesheet) {
|
|||||||
logDebug('Shell stylesheet applied.');
|
logDebug('Shell stylesheet applied.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the given keyval is forbidden.
|
||||||
|
* @param {number} keyval The keyval number.
|
||||||
|
* @returns {boolean} `true` if the keyval is forbidden.
|
||||||
|
*/
|
||||||
function isKeyvalForbidden(keyval) {
|
function isKeyvalForbidden(keyval) {
|
||||||
const forbiddenKeyvals = [
|
const forbiddenKeyvals = [
|
||||||
Gdk.KEY_Home,
|
Gdk.KEY_Home,
|
||||||
@@ -229,6 +234,12 @@ function isKeyvalForbidden(keyval) {
|
|||||||
return forbiddenKeyvals.includes(keyval);
|
return forbiddenKeyvals.includes(keyval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the given key combo is a valid binding
|
||||||
|
* @param {{mask: number, keycode: number, keyval:number}} combo An object
|
||||||
|
* representing the key combo.
|
||||||
|
* @returns {boolean} `true` if the key combo is a valid binding.
|
||||||
|
*/
|
||||||
function isBindingValid({ mask, keycode, keyval }) {
|
function isBindingValid({ mask, keycode, keyval }) {
|
||||||
if ((mask === 0 || mask === Gdk.SHIFT_MASK) && keycode !== 0) {
|
if ((mask === 0 || mask === Gdk.SHIFT_MASK) && keycode !== 0) {
|
||||||
if (
|
if (
|
||||||
@@ -250,6 +261,12 @@ function isBindingValid({ mask, keycode, keyval }) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the given key combo is a valid accelerator.
|
||||||
|
* @param {{mask: number, keyval:number}} combo An object representing the key
|
||||||
|
* combo.
|
||||||
|
* @returns {boolean} `true` if the key combo is a valid accelerator.
|
||||||
|
*/
|
||||||
function isAccelValid({ mask, keyval }) {
|
function isAccelValid({ mask, keyval }) {
|
||||||
return Gtk.accelerator_valid(keyval, mask) || (keyval === Gdk.KEY_Tab && mask !== 0);
|
return Gtk.accelerator_valid(keyval, mask) || (keyval === Gdk.KEY_Tab && mask !== 0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user