Disable Caps Lock in basic?

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
User avatar
presuminged
Drutt
Posts: 11
Joined: Fri Dec 13, 2019 10:54 am
Location: Leeds
Contact:

Disable Caps Lock in basic?

Post by presuminged »

Is there a poke or some other way to do this?

edit - thanks for the replies
Last edited by presuminged on Tue Feb 25, 2020 11:24 am, edited 1 time in total.
User avatar
RWAC
Manic Miner
Posts: 702
Joined: Sun Aug 18, 2019 9:59 pm

Re: Disable Caps Lock in basic?

Post by RWAC »

You can toggle caps lock on and off with
POKE 23658,0 caps off
POKE 23658,8 caps on
User avatar
Ast A. Moore
Rick Dangerous
Posts: 2641
Joined: Mon Nov 13, 2017 3:16 pm

Re: Disable Caps Lock in basic?

Post by Ast A. Moore »

You could try writing to the FLAGS2 system variable (23658). Bit 3 is the CAPS LOCK flag. So POKE 23658,0 should work.
Every man should plant a tree, build a house, and write a ZX Spectrum game.

Author of A Yankee in Iraq, a 50 fps shoot-’em-up—the first game to utilize the floating bus on the +2A/+3,
and zasm Z80 Assembler syntax highlighter.
User avatar
alban lusitanae
Drutt
Posts: 28
Joined: Fri Jun 28, 2019 1:49 pm
Location: Portugal
Contact:

Re: Disable Caps Lock in basic?

Post by alban lusitanae »

Follow up question, how about a POKE TO DISCONNECT THE CAPS KEY?
User avatar
spider
Dynamite Dan
Posts: 1099
Joined: Wed May 01, 2019 10:59 am
Location: Derby, UK
Contact:

Re: Disable Caps Lock in basic?

Post by spider »

alban lusitanae wrote: Sun Mar 06, 2022 6:56 pm Follow up question, how about a POKE TO DISCONNECT THE CAPS KEY?
I don't think you can, as its a ROM routine unless you're going to write your own key handling code for input perhaps. The ROM routine for keyscanning looks a bit messy (to my mind) with regards to doing this.
User avatar
alban lusitanae
Drutt
Posts: 28
Joined: Fri Jun 28, 2019 1:49 pm
Location: Portugal
Contact:

Re: Disable Caps Lock in basic?

Post by alban lusitanae »

I remember there was a way to stop BREAK SPACE, so there should be a way to stop CAPS right?
Post Reply