Unfortunately, your question is too broad, so here you go.
The answer is: you shouldn't do it.
By default, when you open a web page (I wonder why it's different with NVDA for you), traditional screen readers get into a mode that is called virtual cursor in JAWS and browse mode in NVDA. In this mode you cannot type or interact with the page, it's made for better navigation, for example: if you press the H key on the keyboard, you'll jump to the next heading; if you press E, you'll jump to the next edit box (<input type="text">
or <input type="password">
), etc., etc., there are plenty of them. When you arrow up and down, JAWS and NVDA read what is on the page, including text, lists, headings, tables, (labeled) images etc.
If you want your arrow keys to do something without breaking accessibility, either make a web app instead (and then yes, you can mark everything as role="application"
), or clearly separate a part of the web page where you want this special key mode.
To complete the picture, if we need to type, we usually press Enter on the edit box, and then we are brought into forms mode (JAWS terminology) or focus mode (NVDA terminology) which allows us to type and interact with web page controls.