Adding a --forceCaps flag to ensure all keypresses are in caps. Particularly useful if you are multitasking!
This commit is contained in:
parent
d8293e2dda
commit
541d8be170
10
apple2.go
10
apple2.go
|
@ -24,6 +24,7 @@ type Apple2 struct {
|
||||||
showSpeed bool
|
showSpeed bool
|
||||||
paused bool
|
paused bool
|
||||||
traceMLI *traceProDOS
|
traceMLI *traceProDOS
|
||||||
|
forceCaps bool
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -137,6 +138,15 @@ func (a *Apple2) IsProfiling() bool {
|
||||||
return a.profile
|
return a.profile
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a *Apple2) setForceCaps(value bool) {
|
||||||
|
a.forceCaps = value
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsForceCaps returns true when all letters are forced to upper case
|
||||||
|
func (a *Apple2) IsForceCaps() bool {
|
||||||
|
return a.forceCaps
|
||||||
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// CommandToggleSpeed toggles cpu speed between full speed and actual Apple II speed
|
// CommandToggleSpeed toggles cpu speed between full speed and actual Apple II speed
|
||||||
CommandToggleSpeed = iota + 1
|
CommandToggleSpeed = iota + 1
|
||||||
|
|
|
@ -123,6 +123,10 @@ func MainApple() *Apple2 {
|
||||||
"traceMLI",
|
"traceMLI",
|
||||||
false,
|
false,
|
||||||
"dump to the console the calls to ProDOS machine language interface calls to $BF00")
|
"dump to the console the calls to ProDOS machine language interface calls to $BF00")
|
||||||
|
forceCaps := flag.Bool(
|
||||||
|
"forceCaps",
|
||||||
|
false,
|
||||||
|
"force all letters to be uppercased (no need for caps lock!)")
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
@ -144,6 +148,7 @@ func MainApple() *Apple2 {
|
||||||
a.io.setTraceRegistrations(*traceSSReg)
|
a.io.setTraceRegistrations(*traceSSReg)
|
||||||
a.io.setPanicNotImplemented(*panicSS)
|
a.io.setPanicNotImplemented(*panicSS)
|
||||||
a.setProfiling(*profile)
|
a.setProfiling(*profile)
|
||||||
|
a.setForceCaps(*forceCaps)
|
||||||
|
|
||||||
var charGenMap charColumnMap
|
var charGenMap charColumnMap
|
||||||
initialCharGenPage := 0
|
initialCharGenPage := 0
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package izapple2
|
package izapple2
|
||||||
|
|
||||||
|
import "unicode"
|
||||||
|
|
||||||
// KeyboardProvider provides a keyboard implementation
|
// KeyboardProvider provides a keyboard implementation
|
||||||
type KeyboardProvider interface {
|
type KeyboardProvider interface {
|
||||||
GetKey(strobe bool) (key uint8, ok bool)
|
GetKey(strobe bool) (key uint8, ok bool)
|
||||||
|
@ -31,6 +33,9 @@ func (k *KeyboardChannel) PutText(text string) {
|
||||||
func (k *KeyboardChannel) PutRune(ch rune) {
|
func (k *KeyboardChannel) PutRune(ch rune) {
|
||||||
// We will use computed text only for printable ASCII chars
|
// We will use computed text only for printable ASCII chars
|
||||||
if ch >= ' ' && ch <= '~' {
|
if ch >= ' ' && ch <= '~' {
|
||||||
|
if k.a.IsForceCaps() && ch >= 'a' && ch <= 'z' {
|
||||||
|
ch = unicode.ToUpper(ch)
|
||||||
|
}
|
||||||
k.PutChar(uint8(ch))
|
k.PutChar(uint8(ch))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue