Coder Social home page Coder Social logo

pocketnerdio / keyscan Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 4 KB

A tool to show you the ROW and COL of keys on a Psion SIBO/EPOC16 machine.

License: MIT License

Batchfile 17.53% C 82.47%
16bit epoc16 psion sibo epoc series3a series3c series3mx siena workabout

keyscan's Introduction

KeyScan

A tool to show you the ROW and COL of keys on a Psion SIBO/EPOC16 machine.

It is based around the p_getscancodes() function in PLIB, which calls the HwGetScanCodes system call.

It was designed to work out the keyboard wiring for the Siena, but could be used on any SIBO machine running EPOC16 3.18 or later (i.e. the Series 3a onwards, plus HCs that have been updated). It can't be used on earlier machines because HwGetScanCodes wasn't implemented.

How KeyScan works

Every 0.5 seconds, KeyScan will call p_getscancodes(). The output of that is put into an array of 10 words, which represent the physical columns (COLs) of the keyboard. Each bit in a word represents the physical ROWs. KeyScan iterates through each COL and, if any key is pressed (i.e. if scan[i] isn't 0), it works out which ROW has been activated.

KeyScan handles multiple keys pressed on the same COL, and multiple ROWs.

Each line starts with COLc:ROWr (0xrr), which are the COL and ROW in decimal, followed in parentheses by the ROW mask in hex.

At the end of each line, in square brackets, KeyScan prints the COL number and its value in binary, regardless of how many keys have been pressed.

You can exit KeyScan by pressing Psion-Esc.

Compiling

You will need:

  • A copy of DOS (physical machine, in a VM, or DosBox)
  • The Psion SIBO C SDK
  • JPI TopSpeed C 3.0 or later

There are instructions in the SIBO C SDK documentation on how to set up the SDK, including the correct location of files and setting up your PATH environment variable.

To compile, just run make at the command prompt.

C:\PROJECTS\KEYSCAN\>make

To remove the compiled files, run clean (the equivalent of make clean).

C:\PROJECTS\KEYSCAN\>clean

Installing

You will need to copy KEYSCAN.IMG to the IMG folder on the main drive of your SIBO device. If the folder doesn't exist, create it.

You might also need to install RunImg. You can do this on the System Screen by pressing Psion-J, selecting RunImg and pressing Enter.

You should see KEYSCAN below the RunImg icon.

TODO

  • Capture application keys

Other Notes

I've included my c_cpp_properties.json file for Visual Studio Code, in case it's useful to anyone. You will need to change the path so that it points to your copy of SDK. I've set the C standard to C89 and the IntelliSense mode to windows-msvc-x86 - this seems to make IntelliSense complain the least.

keyscan's People

Contributors

pocketnerdio avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.