BBC BASIC
« Improving efficiency and retrieving a key »

Welcome Guest. Please Login or Register.
Mar 31st, 2018, 10:46pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Cross-platform BBC BASIC (Windows, Linux x86, Mac OS-X, Android, iOS, Raspberry Pi)
BBC BASIC Resources
BBC BASIC Help Documentation
BBC BASIC for Windows Home Page
BBC BASIC Programmers' Reference
BBC BASIC Beginners' Tutorial
BBC BASIC for SDL 2.0 Home Page
BBC BASIC Discussion Group

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Improving efficiency and retrieving a key  (Read 309 times)
michael
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 157
xx Improving efficiency and retrieving a key
« Thread started on: Aug 15th, 2017, 01:51am »

This is a VERY efficient way to manage input from the keyboard, yet also keep the CPU cool

This modification is an expansion of Raspberry Pi topic which is greatly dependent on Richards solution,

It is highly valuable on BBCSDL and BBC4W ...



Code:
      k%=0:resp%=0      what%=0      REM This section gives a keypressed value that can be stored to a string      REPEAT        WAIT 1        what%=FNkeychk        IF what%>0 THEN PRINT STR$(what%)+"  "+CHR$(what%)      UNTIL FALSE      END      REM keep FNkeychk and FNmoucheck together      REM ****************************************************************      DEFFNkeychk      REPEAT        k% = INKEY(4)        resp%=FNmoucheck      UNTIL k%<>-1 OR resp% >0      =k%      DEF FNmoucheck      PRIVATE mx%,my%,mb%,x%,y%,b%      MOUSE x%,y%,b%      IF mx%=0 AND my%=0 AND mb%=0 THEN mx%=x%:my%=y%:mb%=b%: =-1      IF mx%=x% AND my%=y% AND mb%=b% THEN =-1 ELSE mx%=x%:my%=y%:mb%=b%:=1      REM ********* END OF EFFICIENT CONTROLS  **************************** 
User IP Logged

I like reinventing the wheel, but for now I will work on tools for D3D
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls