Page 1 of 1
Keyboard PagUp/PagDn with textArea widget
Posted: Thu Apr 12, 2018 5:12 pm
by mjavier
I am using a "textArea" widget to display and edit notes with one of our application and have set the "overflow y" property to "visible". I can scroll up and down with the wheel on the mouse and also by clicking the scroll area above or under the position indicator.
However, the "PagUp/PagDn" on the keyboard does not work using this widget. Is there a way to enable the keyboard PagUp/PagDn keys for this widget? Is there a property that I am not seeing?
Just a note: I noticed that the background (shaded, not in focus) grid does the page up and down with the keyboard keys which is an entirely different program (see attachment).
Any help is appreciated. Thanks!
- Keyboard PagUp/PagDn with textArea widget
- PageUpDown-textArea.jpg (118.56 KiB) Viewed 16367 times
Re: Keyboard PagUp/PagDn with textArea widget
Posted: Thu Apr 12, 2018 5:53 pm
by Scott Klement
You say the underlying screen is a "different program", but that's not really accurate. They are on the same web page in the same web browser. The response from the web page might be sent to a different RPG program on the server -- but, that's not the program that's running when you hit pageup/pagedown... the program that's running is your web browser, and it doesn't know that these are separate, since they are on the same web page.
As far as the widget goes... all it does is insert an HTML <textarea> tag into the page. A text area is a built-in feature of HTML (and therefore also your browser) and it is completely handled by the browser.
You could control it yourself by adding code in the various keyboard events on the widget. (onkeyup, onkeydown, onkeypress) You would need to check which key is pressed, and if its the pageup/pagedown key, you could block it (with the preventEvent() API or similar) so that it's not sent to the underlying screen.
You could also potentially write code that scrolls the text area. I must admit, this is something I've never done... but I strongly suspect there's a way to do it if you Google for it.
(Also, FWIW, Profound cannot generically insert JavaScript for all text areas to handle pageup/down because a lot of customers use text areas inside subfiles, and if we took control of pageup/down, we'd block them from being able to scroll the subfile with the keyboard.)
Re: Keyboard PagUp/PagDn with textArea widget
Posted: Tue Apr 17, 2018 1:54 pm
by mjavier
Thanks Scott for your explanation and suggestion.