0

I don't understand how I get the "correct" key codes for configuring the keyboard map of reveal.js. Some integers work, like 27 for escape, others don't like I need Period (.) and F5 for a logitech presenter (and I don't want to mess with Xorg key mapping). This has no effect:

        Reveal.configure({
            keyboard: {
                46: () => { alert("period") },  // no effect
                'Period': () => { alert("period") }, // no effect
                27: () => { console.log('esc') },  // works
            }
        });

How would I find the correct numbers (?) to remap period and F5?

0__
  • 66,707
  • 21
  • 171
  • 266
  • 1
    https://keycode.info/ gives good information on what keys provide what number. The `.` key (period) is `190`. If you don't want a key to do something, why not try passing `null`? – evolutionxbox Oct 17 '21 at 19:54
  • @evolutionxbox thank you can you post that as answer – 0__ Oct 17 '21 at 19:56
  • I'm not sure it's a helpful answer. "Here's a link to a site which might disappear. Also use `null` like their docs say" – evolutionxbox Oct 17 '21 at 19:57

1 Answers1

0

This way of getting key codes is not correct. This page works correctly: http://javascriptkeycode.com/

Here period is given as 190, and F5 is given as 116.

0__
  • 66,707
  • 21
  • 171
  • 266