Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 21:27 03 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Keyboard for Micromite Plus

     Page 10 of 14    
Author Message
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 03:02am 03 Sep 2015
Copy link to clipboard 
Print this post

You could use a 4017 as i did. Only two pins for 10 rows.
You will need to add a 1n4148 diode on each output of the 4017.
It is the cheapest solution i can think of. A 44 pin is overkill i think.

Microblocks. Build with logic.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9586
Posted: 03:04am 03 Sep 2015
Copy link to clipboard 
Print this post

Let's leave well enough alone, eh?! (rhetorical!)

EDIT - Updated test results:





NO RESPONSE at all from the \ button, 2nd to the right of the spacebar.Edited by Grogster 2015-09-04
Smoke makes things work. When the smoke gets out, it stops!
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 03:27am 03 Sep 2015
Copy link to clipboard 
Print this post

Yep leave the circuit as is. A one chip solution is the best for this project.

Hmmm. That is exactly the same output.
Still miss keys. I hope there is not a mistake in the matrix.

Can you change this line:
[code]DIM Matrix.KeyDown.Debug = 0 'DEBUG[/code]
to this:
[code]DIM Matrix.KeyDown.Debug = 1 'DEBUG[/code]
It will then print a line with the row and column numbers.
Maybe that helps pin down which ones are missing.


Microblocks. Build with logic.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9586
Posted: 03:45am 03 Sep 2015
Copy link to clipboard 
Print this post

RESULTS:

ESC-F12, left to right:





TAB-Delete, left to right:





Caps-Enter, left to right:





LShift-RShift, left to right:





Fn-\, left to right:





Left,Up,Down,Right arrows:





Note that I pressed ENTER at the end of each row, to get a line on the TT screen, so I knew where to crop the screen grabs.......

Unless you actually WANT to do all the work to get this running right, you could just ignore it at this point, as my IF/THEN code works fine, it is just not that efficient and can't handle up/down code etc, but for my purposes, that is not needed anyway.Edited by Grogster 2015-09-04
Smoke makes things work. When the smoke gets out, it stops!
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 03:55am 03 Sep 2015
Copy link to clipboard 
Print this post

Ah i see the mistake.
change in de subroutine this line:
[code]P = row * 8 + col + 1[/code]
into
[code]P = (row - 1) * 8 + col + 1[/code]

I am learning a lot to decode a matrix and handle all the shift/ctrl, more than one key issues etc. I am happy you actually have some hardware to test it on.:)

Edited by TZAdvantage 2015-09-04
Microblocks. Build with logic.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9586
Posted: 03:57am 03 Sep 2015
Copy link to clipboard 
Print this post

...standby...
Smoke makes things work. When the smoke gets out, it stops!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9586
Posted: 04:04am 03 Sep 2015
Copy link to clipboard 
Print this post

RESULT:





The \ key is now producing a result.

ENTER position changed to a + character, so I made that zero, reran the code, and it has move to 59 - is that OK?

How are we progressing now?
Smoke makes things work. When the smoke gets out, it stops!
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 04:09am 03 Sep 2015
Copy link to clipboard 
Print this post

That is much better.
I'll send you a Lookup string within a few minutes so that all the keys return their right character (without shift/control/caps/fn etc for now).

EDIT:
Ok here is the new lookup string and a small modification to allow for the backspace key. Just paste this over the existing part.
Each 'normal' key should return the right character. The 'special' keys return a capital letter, that still has to be processed.
But first get this translation right,before continue to the next step. :)

[code]
'Define positions for ENTER and TAB keys in the Lookup string
DIM Matrix.EnterPosition = 59
DIM Matrix.TabPosition = 21
DIM Matrix.BackSpacePosition = 37

'72 characters in a lookup string 123456789012345678901234567890123456789012345678901234567890123456789012
'for locating the right position "abcdefghijlkmnopqrstuvwxyz1234567890-=[]\;',./~!@#$%^&*()_+{}|:<>?789012"
DIM Matrix.Lookup LENGTH 72 AS STRING = "XcdRLe3XX,lXPu9X zaDTq1`UXsACw2XkSFiBXXOgXfvtr45hnjbyo76X;X./p0-XmMX\X8="
DIM Matrix.LShift LENGTH 72 AS STRING = "xCDxxE#xx<LxxU(x ZAxxQ!~xxSxxW@xKxxIxxxxGxFVTR$%HNJBYO&^x:x>?P)_xMxx|x*+"

'Define the pins that are used for the Rows
DIM integer Matrix.Rows(9) = (0,2,3,4,5,6,7,9,10,25)
dim integer Matrix.NumberOfRows = 9
'Define the pins that are used for the columns
DIM integer Matrix.Cols(7) = (15,16,17,21,22,23,24,26)
dim integer Matrix.NumberOfCols = 7

'We can use A-Z for the modifiers and special keys.
CONST Matrix.Key.LeftShift = ASC("L"), Matrix.Key.RightShift = ASC("S"), Matrix.Key.CapsLock = ASC("C")
CONST Matrix.Key.FN = ASC("F"), Matrix.Key.Control = ASC("O"), Matrix.Key.Option = ASC("P")
CONST Matrix.Key.Command = ASC("M"), Matrix.Key.Tab = 9, Matrix.Key.BackSpace = 8, Matrix.Key.Delete = 127
CONST Matrix.Key.Enter = 13, Matrix.Key.ArrowUp = ASC("U"), Matrix.Key.ArrowLeft = ASC("A")
CONST Matrix.Key.ArrowRight = ASC("R"), Matrix.Key.ArrowDown = ASC("D")

if Matrix.EnterPosition > 0 and Matrix.EnterPosition < 73 then
POKE VAR Matrix.Lookup, Matrix.EnterPosition , Matrix.Key.Enter
endif

if Matrix.TabPosition > 0 and Matrix.TabPosition < 73 then
POKE VAR Matrix.Lookup, Matrix.TabPosition , Matrix.Key.Tab
endif

if Matrix.BackSpacePosition > 0 and Matrix.BackSpacePosition < 73 then
POKE VAR Matrix.Lookup, Matrix.BackSpacePosition , Matrix.Key.BackSpace
endif

if Matrix.Output.Mode = Matrix.Output.Modes.VT100 then
'A DIM within an IF actually works. Did not expect that. :)
DIM STRING Matrix.Output.Key.Enter = chr$(13) + chr$(10)
'Add other key output if it is more then a single character
endif
[/code]



Edited by TZAdvantage 2015-09-04
Microblocks. Build with logic.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9586
Posted: 04:17am 03 Sep 2015
Copy link to clipboard 
Print this post

Take your time - progress takes time, sometimes!!!!

I too am learning a-lot about matracies, but to be honest, I am a little lost in the depth of your code for this, so I will leave you to your talents in that respect!

You have put in a lot of time and work for this, and it is not even your project as you have your own version. My PCB's to fit the keyboards should be here tomorrow or Monday, and I would like to send you a panel of boards as a "Thank you for your efforts" gesture. If you want me to do this, let me know - I still have your address on file from sending you some MM+ boards recently.

As for now, it is quarter past two in the morning, so I am off to get some zzzzz's.
Smoke makes things work. When the smoke gets out, it stops!
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 05:12am 03 Sep 2015
Copy link to clipboard 
Print this post

Yes, would be happy with a pcb that fits the blue keyboard. Thanks you!
That will change the little keyboard into something really useful.
Once mine is finished, i'll send some too.

Ah already late at your timezone.
Sleep well!

Edited by TZAdvantage 2015-09-04
Microblocks. Build with logic.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9586
Posted: 03:20pm 03 Sep 2015
Copy link to clipboard 
Print this post

New code acknowledged. I will try this out later today, and let you know.
Smoke makes things work. When the smoke gets out, it stops!
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9586
Posted: 04:55pm 03 Sep 2015
Copy link to clipboard 
Print this post

RESULTS:




Smoke makes things work. When the smoke gets out, it stops!
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 05:22pm 03 Sep 2015
Copy link to clipboard 
Print this post

Ok that still needs a small tweak in the Lookup string.
[code]
DIM Matrix.Lookup LENGTH 72 AS STRING = "XcdRLe3XX,lXPu9X zaDTq1`UxsACw2XmSFXBXXOgXfvtr45hnjbyo76X;E./p0-XmkX\i8="
DIM Matrix.LShift LENGTH 72 AS STRING = "xCDxxE#xx<LxxU(x ZAxxQ!~xXSxxW@xMxxxxxxxGxFVTR$%HNJBYO&^x:x>?P)_xMKx|i*+"
[/code]
I am working on the capslock and shift.

You can also try to use more then one key.
I do not have a protection against ghosting so it should only work with 2 key rollover.
Edited by TZAdvantage 2015-09-05
Microblocks. Build with logic.
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 05:31pm 03 Sep 2015
Copy link to clipboard 
Print this post

I have a test version for the capslock. Also the LED should work.
I have to go take a nap, worked all night.
Some idiot at the Telecom company screwed up and made 800 of my customers SIMs disappear. All hell broke loose and i am in need of some rest.

While waiting for their repairs,which still are not ready i had time to fiddle with the code bit.
[code]
'This version allows for more key presses at the same time
'without adding diodes.
'It sets all rows to OC (Open Collector) outputs
'All inputs are pulled high internally.
'By MicroBlocks 1 september 2015


CONST Matrix.Output.Modes.RAW = 1, Matrix.Output.Modes.ASCII = 2, Matrix.Output.Modes.VT100 = 3
'Matrix.Output.Mode = Matrix.Output.Modes.RAW
'Matrix.Output.Mode = Matrix.Output.Modes.ASCII
Matrix.Output.Mode = Matrix.Output.Modes.VT100

'Enable/Disabe debug messages per subroutine
DIM Main.Debug = 1 'DEBUG
DIM Matrix.Debug = 0 'DEBUG
DIM Matrix.ProcessScan.Debug = 0 'DEBUG
DIM Matrix.KeyDown.Debug = 0 'DEBUG
DIM Matrix.KeyUp.Debug = 0 'DEBUG

'Define positions for Enter,Tab,Backspace keys in the Lookup string
DIM Matrix.EnterPosition = 59
DIM Matrix.TabPosition = 21
DIM Matrix.BackSpacePosition = 37

'72 characters in a lookup string 123456789012345678901234567890123456789012345678901234567890123456789012
'for locating the right position "abcdefghijlkmnopqrstuvwxyz1234567890-=[]\;',./~!@#$%^&*()_+{}|:<>?789012"
DIM Matrix.Lookup LENGTH 72 AS STRING = "XcdRLe3XX,lXPu9X zaDTq1`UxsACw2XmSFXBXXOgXfvtr45hnjbyo76X;E./p0-XmkX\i8="
DIM Matrix.LShift LENGTH 72 AS STRING = "xCDxxE#xx<LxxU(x ZAxxQ!~xXSxxW@xMxxxxxxxGxFVTR$%HNJBYO&^x:x>?P)_xMKx|i*+"

'Define the pins that are used for the Rows
DIM integer Matrix.Rows(9) = (0,2,3,4,5,6,7,9,10,25)
dim integer Matrix.NumberOfRows = 9
'Define the pins that are used for the columns
DIM integer Matrix.Cols(7) = (15,16,17,21,22,23,24,26)
dim integer Matrix.NumberOfCols = 7
'Define the pins for CapsLock and other indicators
DIM INTEGER Matrix.Indicators.CapsLock.Pin = 18
DIm integer Matrix.Indicators.Power.Pin = 14


'We can use A-Z for the modifiers and special keys.
CONST Matrix.Key.LeftShift = ASC("L"), Matrix.Key.RightShift = ASC("S"), Matrix.Key.CapsLock = ASC("C")
CONST Matrix.Key.FN = ASC("F"), Matrix.Key.Control = ASC("O"), Matrix.Key.Option = ASC("P")
CONST Matrix.Key.Command = ASC("M"), Matrix.Key.Tab = 9, Matrix.Key.BackSpace = 8, Matrix.Key.Delete = 127
CONST Matrix.Key.Enter = 13, Matrix.Key.ArrowUp = ASC("U"), Matrix.Key.ArrowLeft = ASC("A")
CONST Matrix.Key.ArrowRight = ASC("R"), Matrix.Key.ArrowDown = ASC("D")

if Matrix.EnterPosition > 0 and Matrix.EnterPosition < 73 then
POKE VAR Matrix.Lookup, Matrix.EnterPosition , Matrix.Key.Enter
endif

if Matrix.TabPosition > 0 and Matrix.TabPosition < 73 then
POKE VAR Matrix.Lookup, Matrix.TabPosition , Matrix.Key.Tab
endif

if Matrix.BackSpacePosition > 0 and Matrix.BackSpacePosition < 73 then
POKE VAR Matrix.Lookup, Matrix.BackSpacePosition , Matrix.Key.BackSpace
endif

if Matrix.Output.Mode = Matrix.Output.Modes.VT100 then
'A DIM within an IF actually works. Did not expect that. :)
DIM STRING Matrix.Output.Key.Enter = chr$(13) + chr$(10)
'Add other key output if it is more then a single character
endif

CONST Matrix.SCANRATE = 10 'Scans are done twice for debouncing
CONST Matrix.REPEATRATE = 10 'Keys will be repeated REPEATRATE * SCANRATE ms.
Dim integer Matrix.State = 0 'Will be 1 for the first read and 2 for the second read that will give the debounced scanCodes
'It goes up until REPEATRATE where repeatable keys that were hold down are repeated. Then back to 0
Dim INTEGeR Matrix.FirstScan = 0
DIM INTEGER Matrix.ScanCode= 0
DIM INTEGER Matrix.ScanCount = 0

DIM integer Matrix.Modifier.CapsLock = 0, Matrix.Modifier.LeftShift = 0, Matrix.Modifier.RightShift = 0
DIM integer Matrix.Modifier.FN = 0, Matrix.Modifier.Control = 0, Matrix.Modifier.Alt = 0
dim integer Matrix.Modifier.GUI = 0

DIM INTEGER Matrix.Prev(9)
Dim integer Matrix.Current(9)
DIM Matrix.Buffer$ = ""

'Setup all rows as output with open collector
For Row = 1 to Matrix.NumberOfRows
Setpin Matrix.Rows(Row),dout,OC
next

'Setup all columns as input with a pullup
For Col = 0 to Matrix.NumberOfCols
Setpin Matrix.Cols(Col),din,pullup
next

SETTICK Matrix.SCANRATE, Matrix.Scan, 1

if Matrix.EnterPosition = 0 then 'DEBUG
print "Press the ENTER button now" 'DEBUG
else 'DEBUG
print "Each following key will give the character" 'DEBUG
print "in the lookup string on line 27. You can change it to the rigth" 'DEBUG
print "value by looking up the character that appears on the screen" 'DEBUG
print "and change it to its real character." 'DEBUG
print "Have fun!" 'DEBUG
endif 'DEBUG

'MAIN
Do
if len(Matrix.Buffer$) > 0 then
Keys$ = Matrix.Buffer$: Matrix.Buffer$ = ""
print Keys$;
if Matrix.EnterPosition = 0 then print 'DEBUG
endif
'Maybe do some other interesting stuff
Loop

SUB UpdateIndicators()
PIN(Matrix.Indicators.CapsLock.Pin) = Matrix.Modifier.CapsLock & 1
PIN(Matrix.Indicators.Power.Pin) = Matrix.Indicators.Power & 1
END SUB

SUB Matrix.SetRow(row)
LOCAL integer Value = 0
if row > 0 then Value = 511 - (2 ^ (row-1))
PORT(2,6,9,2,25,1) = Value
END SUB

FUNCTION Matrix.ReadCols()
'Column pins 15,16,17,21,22,23,24,26
Matrix.ReadCols = 255 - PORT(15,3,21,4,26,1)
END FUNCTION

SUB Matrix.Scan()
LOCAL integer Row

Matrix.ScanCount = Matrix.ScanCount + 1

if Matrix.ScanCount = Matrix.REPEATRATE then
Matrix.RepeatKeys
Matrix.ScanCount = 0
endIF

IF Matrix.State = 0 then
Matrix.SetRow 0
Matrix.State = 1
ENDIF

if Matrix.State = 1 then
Matrix.FirstScan = Matrix.ReadCols()
Matrix.State = 2
exit sub
endif

if Matrix.State = 2 THEN
Matrix.ScanCode = Matrix.ReadCols()
if Matrix.FirstScan <> Matrix.ScanCode then
'Unreliable scan values detected
Matrix.FirstScan = Matrix.ScanCode
EXIT SUB
ENDIF

if Matrix.ScanCode = 0 then
Matrix.ReleaseKeys
Matrix.State = 1
exit sub
endif

'Scan the whole matrix
for Row = 1 to Matrix.NumberOfRows
Matrix.SetRow(Row)
'Maybe need a tiny delay to allow for correct read
Matrix.Current(Row) = Matrix.ReadCols()
next
Matrix.ProcessScan
RepeatKey = 0
Matrix.State = 0
EXIT SUB
ENDIF
'Should never end up here.
'If it does then reset state
Matrix.State = 0
RepeatKey = 0
Matrix.ScanCount = 0
END SUB

SUB Matrix.ReleaseKeys()
LOCAL Row,Col
'release ALL keys
for Row = 1 to Matrix.NumberOfRows
if Matrix.Prev(Row) > 0 then
for Col = 0 to Matrix.NumberOfCols
if (Matrix.Prev(Row) AND (2 ^ Col) ) > 0 then
'If the key was pressed previous scan then release it by calling keyup
Matrix.KeyUp Row, Col
endif
next
endif
Matrix.Prev(Row) = 0
next
end SUB

SUB Matrix.ProcessScan()
LOCAL integer Row, Col, Changes
for Row = 1 to Matrix.NumberOfRows
Changes = Matrix.Prev(Row) XOR Matrix.Current(Row) ' every bit that changed will be 1
if Matrix.ProcessScan.Debug = 1 then print "Prev:"Matrix.Prev(Row)"Cur:"Matrix.Current(Row)"Changes" Changes; 'DEBUG
if Changes > 0 then
for Col = 0 to Matrix.NumberOfCols
P = 2 ^ Col
'if Matrix.Debug = 1 then Print P;
if (Changes AND P) > 0 then
if (Matrix.Current(Row) AND P) = 0 then
Matrix.KeyUp Row, Col
else
Matrix.KeyDown Row, Col
endif
endif
next
endif
if Matrix.ProcessScan.Debug = 1 then print 'DEBUG
Matrix.Prev(Row) = Matrix.Current(Row)
next
end SUB

SUB Matrix.KeyDown(row, col)
LOCAL Key$, K, P
P = (row - 1) * 8 + col + 1
if Matrix.KeyDown.Debug = 1 or Matrix.EnterPosition = 0 then 'DEBUG
print "KeyDown R:" row " C:" col " P:" P 'DEBUG
endif 'DEBUG
if Matrix.EnterPosition = 0 then 'DEBUG
Matrix.EnterPosition = P 'DEBUG
POKE VAR Matrix.Lookup, Matrix.EnterPosition , Matrix.Key.Enter 'DEBUG
print "Enter key has been set. Its position is" P 'DEBUG
print 'DEBUG
PRINT "Change the code on line 22 to:" 'DEBUG
print "DIM Matrix.EnterPosition ="P 'DEBUG
print
print "Stopping program. Use Edit or MMEdit now" 'DEBUG
print "To change the code." 'DEBUG
END 'DEBUG
endif 'DEBUG
Key$ = MID$(Matrix.Lookup, P, 1)
K = ASC(Key$)

IF K = Matrix.Key.CapsLock then
Matrix.Modifier.CapsLock = NOT Matrix.Modifier.CapsLock
UpdateIndicators
endif

IF Matrix.Modifier.CapsLock = 1 then
if K >= ASC("a") and K <= ASC("z") then Key$ = Ucase$(Key$)
ENDIF
if Matrix.Output.Mode <> Matrix.Output.Modes.RAW then
if Key$ = chr$(13) then Key$ = Matrix.Output.Key.Enter
'more to add later
endif
Matrix.Buffer$ = Matrix.Buffer$ + Key$
END SUB

SUB Matrix.KeyUp(row,col)
if Matrix.KeyUp.Debug = 1 then print "KeyUp R:" row " C:" col 'DEBUG
end SUB

SUB Matrix.RepeatKeys()
LOCAL A = 1
END SUB
[/code]
Hope it works. :)


Microblocks. Build with logic.
 
Frank N. Furter
Guru

Joined: 28/05/2012
Location: Germany
Posts: 946
Posted: 10:35pm 03 Sep 2015
Copy link to clipboard 
Print this post

Hi!

Can anybody post the actual circuit??? I would like to adapt it to another keyboard...

Thanks!

Frank
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 11:10pm 03 Sep 2015
Copy link to clipboard 
Print this post

Hi Frank,

On page 15 there is a picture with the row and columns pins.

It uses a 9 rows by 8 columns matrix.
Smaller ones you just connect starting with R1 and C1.

(It could work with a bigger matrix but that needs some adjustments in de program and you would need a bigger version of the chip with more pins.
No diodes are necessary as it uses Open Collector outputs and internal pullups on the inputs.

Microblocks. Build with logic.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9586
Posted: 12:22am 04 Sep 2015
Copy link to clipboard 
Print this post

RESULT:




Smoke makes things work. When the smoke gets out, it stops!
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 12:25am 04 Sep 2015
Copy link to clipboard 
Print this post

Oh boy. I am in C writing mode today.
The & should be AND in basic. How dumb was that. :)
The next line has the same.

Microblocks. Build with logic.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9586
Posted: 12:30am 04 Sep 2015
Copy link to clipboard 
Print this post

RESULT:





I went back and pressed CAPS again at the end of the first test, then repeated those rows. Seems to be handling the CAPS LOCK key OK. No CAPS LED at the moment, but when you get time.....

EDIT: Any reason you are using upper-case character for the control keys, rather then using non-printable control codes? I was using mostly codes from 00 to 1F for special control keys. These are non-printable character codes.

If you press CAPS LOCK, then F, you will get an 'F', and is the connected MCU not going to have a hard time deciding if this is an 'F' or a 'Fn' code?Edited by Grogster 2015-09-05
Smoke makes things work. When the smoke gets out, it stops!
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 01:28am 04 Sep 2015
Copy link to clipboard 
Print this post

The CapsLED should have worked. I'll check....
Ok i forget to use setpin.
You can add the following lines starting at line 91 right after the pins for the rows and cols are set:
[code]
'Setup CapsLock and Power pins
SETPIN Matrix.Indicators.CapsLock.Pin, DOUT
SETPIN Matrix.Indicators.Power.Pin, DOUT
[/code]


I used readable character because i use a lookup string.
All keys pressed will be lowercase because it is still unmodified.
A capital letter is easy to add to the lookup string as it is just text.
Otherwise the lookup string would need a lot of +CHR$()+ and that will make it long and difficult to read.
So in the case a key is pressed it is looked up. If it is a special key (A-Z) then that needs to be processed and will not result in a character being send.
Once a shift is detected then the second lookup string has all the shifted values. These are all capital letters and special characters. A small x is invalid so i can test for that and not output anything if the combination is not allowed.
At the end none of the capital letters in the first lookup string will reach the output.

The Fn key will not output anything by itself. For instance if you hold Fn and press 3 then the code for F3 will be send. (This still needs to be done).


Edited by TZAdvantage 2015-09-05
Microblocks. Build with logic.
 
     Page 10 of 14    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025