1

How can one unselect a post that has been selected with a keyboard shortcut without selecting another one or reloading/changing the page?


2
  • 1
    @Makyen If you know a way to select a post without using a keyboard shortcut, can you please an answer on Is editing a post the only way to select a post? Commented Jun 20 at 0:50
  • 1
    Frank, the issue is you're using a specialized concept of what "select a post" means that's inherently, and only, part of the site-specific keyboard shortcuts SE provides as an optional UI interaction method. There are at least a couple of other concepts as to what "select a post" could mean, even if just exclusively talking about question pages. What you've really meant by "select a post" here and in your linked question is more accurately something like "on a question page, cause a post to be recognized as 'selected' within SE's optional keyboard shortcuts".
    – Makyen
    Commented Jun 20 at 6:20

1 Answer 1

4

Not possible by default

The keyboard shortcuts only allow you to change selection once there is one. Reloading is the only way to stop having a selected post.


Possible with some custom code

To remove the selection it is enough to remove the "keyboard-selected" class. The following jQuery code will achieve that:

$(".keyboard-selected").removeClass("keyboard-selected")

This can be converted to a bookmarklet:

javascript:(function()%7B%24(%22.keyboard-selected%22).removeClass(%22keyboard-selected%22)%7D)()

To add it to your browser see How to Create Bookmarklets

This could also be incorporated into a userscript or a browser extension (for example, it could be executed when pressing a key).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .