APL NARS 81 77 54 characters
{1<⍴⍴⍵:¯1⋄⍬≡0↑⍵:¯1⋄⍵≡'':⍵⋄{26<c←⎕a⍳⍵:⍵⋄1=?2:c⌷⎕A⋄⍵}¨⍵}
This can run only in NARS, because it has defined both alphabet array ⎕A for 'A..Z' and ⎕a for 'a..z'. It is 90% sure I wrote something wrong because it is the 4 or 5th function I write in APL; if you note some error please report. I like this language, a little too much path idiomatic. Comments:
h←{1<⍴⍴⍵:¯1⋄⍬≡0↑⍵:¯1⋄⍵≡'':⍵⋄{26<c←⎕a⍳⍵:⍵⋄1=?2:c⌷⎕A⋄⍵}¨⍵}
h← assign to name h its function, h return -1 for error
{1<⍴⍴⍵:¯1 if the argument ⍵ of h is matrix or tensor return -1
⍬≡0↑⍵:¯1 if the argument ⍵ of h is a scalar numeric or vector numeric return -1
⍵≡'':⍵ if the argument ⍵ of h is the void string '' return it
{ define one anonimous function in h with argument ⍵
find in the vector ⎕a=a..z the index char ⍵, assign it to c
26<c←⎕a⍳⍵:⍵
if that index not exist [in this case must be c=27]return unchanged ⍵
1=?2:c⌷⎕A
now index is in 1..26, ⍵ is in a..z; if rand() in 1..2 is 1, return ⎕A[c] where ⎕A is A..Z
⋄⍵ else return the argument unchanged
¨⍵} for each character argument ⍵ of h, apply anonimous function
for build the result string and return it
results
h
SYNTAX ERROR
h
∧
h 1
¯1
h 1.23
¯1
h 1 2 3
¯1
h 2 3⍴1 2 3
¯1
h ''
h ' '
h ' '
h 'Hello World'
HElLo WOrlD
h 'Hello World'
HELlo WoRlD
h 'Hello World'
HELlO WoRLD
h 'Hello World'
HeLLO WOrld
h 'Hello World'
HEllO WORld
these it seems are scalars chars and some vector
h 'a'
A
h 'a'
a
h 'a'
a
h 'a'
a
h ,'a'
A
h ,'a'
A
h ,'a'
a
h ,''
The apps "MirageOS" and "OmniCalc" both allow you to type lowercase letters just by pressing alpha twice. And they also have other nice features. – Fabian Röling – 2017-12-01T07:45:59.533
@Fabian The assembly script, and the apps you mentioned, both work essentially the same way: they set a flag in the operating system that enables "press alpha twice for lowercase". – Misha Lavrov – 2017-12-01T07:51:48.060