Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.140.053 Times

Non-wait detection of keyboard input (including MEX implementation) 1.0

  Date Added: August 28, 2013  |  Visits: 349

Non-wait detection of keyboard input (including MEX implementation)

Report Broken Link
Printer Friendly Version


Product Homepage
Download (48 downloads)



These functions retrieve the last key pressed in the command window without having to explicitly wait for input. Useful for situations where code is executing and you want to poll for keyboard input but you don't want hidden figures. For example, mexKbhit can be used to interrupt a MEX function while it's executing.The code taps into the command window's key press callback function. Each time a key is pressed, a small piece of m code is run to save the key event. A call to kbhit (or mexKbhit in MEX code) will return information about the key event, such as the ascii code and the related character, and whether Control, Alt and/or Shift was also entered.Warning : mexKbhit calls the matlab function kbhit. While CTRL+C doesn't interrupt MEX functions, it will interrupt matlab functions called by a MEX function. Therefore, the key combo CTRL+C may cause problems when your MEX function is executing mexKbhit.Big acknowledgements to Yair Altman in the MATLAB newsreader thread "java: add keyListener to command window", for providing the exact code needed to set up the key press callback.Files:kbhit.m - matlab functionmexKbhit.h - MEX c file headermexKBhit.c - MEX c file, including instructions for building the librarymexKbhitDemo.c - demonstration code for using the MEX library.Example use of Matlab function :kbhit('init');fprintf(1, 'Five seconds to type something ...');pause(5);key = kbhit; fprintf(1, 'Character : %cn', key);key = kbhit('struct'); fprintf(1, 'Key struct :n'); disp(key)[key, ctrlc] = kbhit('event'); fprintf(1, 'Key event :n'); disp(key)fprintf(1, 'Ctrl+c pressed ? %dn', ctrlc);kbhit('stop')Example use of MEX library :clock_t t;struct key k;init_mexKbhit();t = clock();// poll for 5 secondsmexPrintf("Wait 5 seconds ... ");mexEvalString("drawnow");while ((clock()-t)/CLOCKS_PER_SEC < 5) { k = mexKbhit(); if (k.character == 'C' && k.ctrl == 1) { mexPrintf("interrupted by Ctrl+c! "); break; }}

Requirements: No special requirements
Platforms: Matlab
Keyword: Building Header Including Instructions Kbhit Init Library Matlab Mexkbhitc Mexkbhitdemoc
Users rating: 0/10

License: Shareware Size: 10 KB
USER REVIEWS
More Reviews or Write Review


NON-WAIT DETECTION OF KEYBOARD INPUT (INCLUDING MEX IMPLEMENTATION) RELATED
Communication  -  Finite Volume Poisson Solver 1.0
C-Library & Matlab Toolbox implement a numerical solution of Poisson equationdiv(e*grad(u))=ffor Cartesian 1D, Cartesian 2D and axis-symmetrical cylindrical coordinates with respect to steeply varying dielectrical permittivity e.Library uses...
30.72 KB  
Development Tools  -  3D Finite Volume Poisson Solver For Ion Channels 1.0
C-Library & Matlab Toolbox implement a numerical solution of Poisson equationdiv(e*grad(u))=fin Cartesizan 3D coordinates with respect to steeply varying dielectrical permittivity e. Library uses regular rectangular grid with mixed boundary...
716.8 KB  
Programming  -  pseudoDB 1.0
pseudoDB doesn???*a*?t actually make a connection to a MySQL database itself. Instead, it communicates to a MySQL database through a PHP script. The class comes with complete instructions (including instructions on how to activate PHP on your own...
40.96 KB  
Programming  -  MASkinG GUI library 0.80
MASkinG is an addon library for the Allegro game programming library intended for building GUI applications in C++.
921.6 KB  
Development Editors  -  BioSig for Octave and Matlab 2.52
BioSig is an open source software library for biomedical signal processing, featuring for example the analysis of biosignals such as the electroencephalogram (EEG), electrocorticogram (ECoG), electrocardiogram (ECG), electrooculogram (EOG),...
6.8 MB  
Scientific and Engineering  -  Matplotlib 0.90.1
matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. matplotlib can be used in python scripts, the python and ipython shell (ala...
 
Games  -  Universal Distributed Simulation Library 0.1.3
UDSL is abreviation of Universal Distributed Simulation Library. This is library for building flexible distributed simulation systems. This library uses Object Oriented appoach and based on distributed and decentralized architecture.
553.94 KB  
Development Tools  -  Langmuir probe data analysis code 1.0
A computer code for plasma Langmuir probe analysis is presented here. The code uses a four parameters fitting method to deduce plasma properties including the ion and electron saturation currents, plasma potential, plasma electron temperature, the...
30.72 KB  
Development Tools  -  SIMULINK Interface for APMonitor 1.0
The template includes an s-function (sfun_cstr_apm.m), SIMULINK model (cstr_simulink.mdl), cellwrite.m (also available on Matlab Central), and several APMonitor files for a CSTR example.The operating instructions for this interface is provided in...
10 KB  
Audio Tools  -  ImLib3D 0.9.2
ImLib3D is an open source C++ library for 3D (volumetric) image processing. Focus has been put on simplicity for the developer. It contains most basic image processing algorithms, and some more sophisticated ones. It comes with an optional viewer...
501.76 KB  
NEW DOWNLOADS IN SCRIPTS, DEVELOPMENT TOOLS
Scripts  -  Freelancer Script 5.05
Main Features: 100% Secured. Email Support (3 Years). FREE Updates (3 Years). Post projects. Featured projects. Private projects. Sealed projects. Edit/delete projects. Select freelancers....
5.49 MB  
Scripts  -  B2B Script 4.20
Main Features: 100% Secured. Email Support (3 Years). FREE Updates (3 Years). Sign-up Account (Registration of account). Lead generation tools (for the sellers). Email verification to...
5.49 MB  
Scripts  -  B2C Script 5.06
Main Features: 100% Secured. Email Support (3 Years). FREE Updates (3 Years). The script comes with totally editable site colors, icons and graphics Multilevel categories allows extensive browsing Admin can change Category ordering or...
5.49 MB  
Scripts  -  Social Networking Script 2.86
Main Features: 100% Secured. Email Support (3 Years). FREE Updates (3 Years). Registration with name, email, password, date of birth etc. User can add multiple school, college, university with start...
5.49 MB  
Scripts  -  Business Networking Script 8.04
Main Features: 100% Secured. Email Support (3 Years). FREE Updates (3 Years). Ajax based interface. Profile creation. Different types of profile. Profile for jobseekers, employers and employed...
5.49 MB  
Development Tools  -  Aml2CHM 3.50
Those who use the popular Aml Pages text editor might be looking out for a way of generating help files from their text and notes. Aml2CHM is a plug-in that was developed to offer people a quick and efficient way of converting Aml Pages documents...
549.99 KB  
Development Tools  -  VMP Viewer 1.0
This is a very rudimentary tool to visualize the VMP files generated by BrainVoyager. Useful to share files with people who do not have BV.
10 KB  
Development Tools  -  Sending reports and timestamped file by emailing 1.0
main executing reference usage:[1] usage_send_mail.mIllustrates email sending with multiple separate files or single timestamped tar file. Attachment failure is properly handled, with continuation of report emailing without the attachment.[2]...
768 KB  
Development Tools  -  IrisMVC 2.0 rc1
IrisMVC is an OOP PHP framework that developers can use as a strong and secure foundation to build on various web applications following the Model-View-Controller (MVC) pattern. It provides the basic functionality developers need, without...
51.2 KB  
Development Tools  -  7-Zip for Script 4.42
7-Zip is a file archiver with a high compression ratio.Features:- High compression ratio in new 7z format with LZMA compression- Supported formats:- Packing / unpacking: 7z, ZIP, GZIP, BZIP2 and TAR- Unpacking only: RAR, CAB, ISO, ARJ, LZH, CHM,...
624.64 KB