question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

up down left right don't response

See original GitHub issue

run command

deno run --unstable https://deno.land/x/cliffy/examples/keycode/read_key.ts

up down left right don’t response, But the other keys on the area like number keys can use normally.

It lead to the module such as ‘checkbox’ ‘select’ which need to use with ‘up/down’ key can not use conveniently. Change c configuration button parameter were not found either.

It seems like the ‘deno’ doesn’t response to key-press originally.

deno 1.12.2 win10 1809 system locale zh-cn

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
c4sparcommented, Aug 22, 2021

u and d means up and down, someone made a pr to add these aliases. 8 and 2 works for up and down too. But you can also override all keys with the keys option and show some info with ether the info or hint option.

const colors: Array<string> = await Checkbox.prompt({
  message: "Pick a color",
  options: [
    { name: "Red", value: "#ff0000" },
    { name: "Green", value: "#00ff00" },
    { name: "Blue", value: "#0000ff" },
    { name: "White", value: "#ffffff" },
    { name: "Black", value: "#000000" },
  ],
  keys: {
    next: ["down", "j"],
    previous: ["up", "k"],
  },
  info: true,
  hint: "Press k or j for up and down.",
});

The info option prints something like:

 ℹ 1/5 Next: ↓, Previous: ↑, Next Page: ⇟, Previous Page: ⇞, Submit: ↵

But the symbols are currently hardcoded, will make a pr to fix this so it will look like this:

 ℹ 1/5 Next: ↓, j, Previous: ↑, k, Next Page: ⇟, Previous Page: ⇞, Submit: ↵

With the hint option you can display any info you want.

0reactions
JohannesRudolphcommented, Sep 29, 2022

I noticed the fix in #274 is not complete.

Here’s a prompt with info: true

 ? Select a kit module from your repository
 ❯ azure/bootstrap azure\bootstrap
   azure/org azure\org
 ℹ 1/2 Next: ↓, d, n, 2, Previous: ↑, u, p, 8, Next Page: ⇟, →, Previous Page: ⇞, ←, Submit: ↵

and here’s a prompt with info: true, search: true

 ? Select a kit module from your repository ⌕
 ❯ azure/bootstrap azure\bootstrap
   azure/org azure\org
 ℹ 1/2 Next: ↓, Previous: ↑, Next Page: ⇟, →, Previous Page: ⇞, ←, Submit: ↵

The problem is that the up & down arrows suggested to the user by cliffy don’t work. I get why search and u/d keys are incompatible - so for now I’m just disabling search on windows, which provides a very degraded experience.

Not sure what a good fix it, this is really an upstream deno problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

up and down arrow keys don't work properly.
Here's how: in Device Manager, right-click (or tap and hold) your touchpad driver > Update driver software... > Browse my computer for driver ......
Read more >
Keyboard Arrow Keys Not Working? Try These Fixes!
The arrow keys may stop working due to various reasons. But don't worry. Here we'll show you how to get them working correctly...
Read more >
Up, Down, Left and Right arrow keys do not trigger KeyDown ...
I am building an application where all the key input must be handled by the windows itself. I set tabstop to false for...
Read more >
Directional buttons not responsive - DualShock 4 - iFixit
Directional buttons not responsive. On my original PS4 controller (got another one when I upgraded to PS4 Pro), the up, down, left and...
Read more >
Up and Down Arrow Keys Not Working on MacBook Pro M1 Max
I got a new MacBook Pro M1 Max a few days ago. I just noticed that my up and down arrow keys are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found