Skip to content

RISC OS module allowing applications to disable the usual behaviour of the Alt keys by the keyboard handler and have access to the raw key presses.

License

Notifications You must be signed in to change notification settings

effarig/ro-bypassalt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BypassAlt

Requirements

RISC OS 3.5 or later. 26/32 bit compatible.

Installation

Use the !Boot System merge tool to merge the supplied system with the one in this distribution. Or if you prefer, it can be manually installed in System:350.Modules.

Introduction

Usually, under RISC OS, the Alt keys are acted on by the key handler to provide useful key combinations such as the copyright symbol (Alt-C) or accented characters (eg Alt-[ e).

For certain applcations (eg VNC remote desktop clients), this is a serious inconveniance as it becomes impossible to access the unadulterated ASCII key presses from the desktop in a practical way meaning that Alt-C, for example, cannot be entered from the keyboard.

So this module works around this by doing two rather nasty things:

  1. Intercepting Alt key transitions on KeyV, stopping them reaching the key handler and being interpreted as part of a special key press. In an attempt at portability, it reads the low-level internal key numbers for Alt from the Key Handler. The state of each Alt key is stored.

  2. Intercepts the OS_Byte calls for scanning the keyboard so applcations can check for Alt in the usual fashion. Any non-Alt scan is passed on to the kernel code.

Because of the invasive nature of this module, applications should only enable it when the relevant window has control of the caret. Note that the module will not fuction correctly with RISC OS versions below 3.50, so any programs expecting to function on those systems should fallback sensibly and not attempt to load the module on those machines. The API is specified below.

SWI BypassAlt_Enable (&58680)

=> r0 = 0
<= All registers preserved. CZN undefined, V clear.
   Errors can be returned with V set and R0 => SWI Error block.

Call to enable Alt key bypassing. Typically this would be called from the wimp window gaining caret event. Multiple calls to BypassAlt_Enable are allowed.

SWI BypassAlt_Disable (&58681)

=> r0 = 0
<= All registers preserved. CZN undefined, V clear.
   Errors can be returned with V set and R0 => SWI Error block.

Call to disable Alt key bypassing. Typically this would be called from the wimp window losing caret event. Care needs to be taked when the task exits, the window is closed or the window is destroyed. The Alt bypassing will only be disabled when there has been one disable call for each enable one.

Comments and Updates

The latest release is on GitHub https://github.com/effarig/ro-bypassalt.

Please and send any bug reports, comments, suggestions etc. using GitHub.

Changes

0.01 (30-Dec-2005):

  • First version.

1.00 (30-Dec-2021):

  • Migrating to GitHub; no functional difference.
  • Removed tabs from source.
  • !ReadMe now markdown.
  • Fix PSR flag names in !ReadMe.
  • Email address and URL updated.
  • License moved into LICENSE file and included in distribution.

License

See LICENSE file.

About

RISC OS module allowing applications to disable the usual behaviour of the Alt keys by the keyboard handler and have access to the raw key presses.

Topics

Resources

License

Stars

Watchers

Forks