Kbshift
Read/Change Keyboard Shift Status
Kbshift() Opcode = 11
T h is fu n ctio n re tu rn s in fo rm a tio n a b o ut th e sta tu s o f th e sp ecial sh ift k ey s,
in clu d in g C on tro l a n d A ltern ate. It ca n als o be u sed to ch a n g e th e shift
statu s.
C macro format
in t sh iftco d e, m od e;
sh iftcod e = K b sh ift(m o de );
Machine language format
m o v e .w # m o d e , - (sp )
m o v e .w # 1 1 , - (sp)
trap # 1 3
a d d q .l # 4 ,s p
Inputs
m o d e w o rd Mode is a flag th at in d icate s w h eth er y o u
w ish to re ad o r se t th e sh ift sta tu s. A
n e g ativ e v alu e in m o d e re q u ests a statu s
re a d . A p o sitiv e v alu e ca u se s th e fu nction
to s et th e statu s co d e to th e v alu e in di
ca te d , a fte r re ad in g th e cu rre n t co d e
v alu e.
Results
DO sh iftco d e lo n g A bit flag th at in d icate s w h ich of th e shift k ey s are
cu rren tly p res sed . A bit th at's se t to 1 in d icate s
th a t th e k ey w a s p re ss ed w h en th e call w a s m a d e.
N o te th at sin ce k ey s re ad w ith B c o n i n () are bu ffered , th e sh ift sta tu s
at th e tim e K b s h if t() is called is n o t n ece ssarily th e sa m e as w h e n th e last
ch a ra cte r w a s re a d w ith B c o n in (). T h e bit as sig n m en ts are :
Bit Number Bit Value Shift Key
0 1 R ig h t shift k ey
1 2 L eft shift ke y
2 4 C o n tro l k ey
3 8 A lte rn a te k ey
4 1 6 C a p s lo ck on
5 3 2 A ltern ate -C lr/H o m e k ey com b in atio n (k ey b oa rd
eq u iv alen t fo r righ t m o u se b u tto n )
6 6 4 A H e rn ate -In se rt k ey co m b in atio n (k ey b o ard
eq u iv alen t fo r left m o u se b u tto n )
7 12 8 R e se rv ed (cu rre n tly 0)
See also
B c o n in ()
186