File Exchange

image thumbnail

Simulink Keyboard Input v2

version 1.2.0.0 (10.9 KB) by Emanuele Ruffaldi
Allows to read input keyboard during Simulink simulation

31 Downloads

Updated 02 Dec 2016

View License

Improvements respect original "Simulink Keyboard Input":
- second output for triggering key arrival (for Subsystems and Char)
- inherited sampling time
- close window on close
- handle of window as state so faster response
- Level-2 S-Function

Cite As

Emanuele Ruffaldi (2020). Simulink Keyboard Input v2 (https://www.mathworks.com/matlabcentral/fileexchange/24216-simulink-keyboard-input-v2), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (12)

Haihui Zhu

Qingyu

Works perfect. Thank you.

Nice! But as "abdulqader" said I would very much like to use this in Simulink Real-Time but the 'sfun_keyboard_input_v1_2.tlc' error is the problem. Do you have this?

Very nice! Would you have any idea on keeping track of how long a key is pressed?

Leo Müller

Great function!
How do I get the input window on top?
The input does not work whenever another figure pops up...

Fabian Beck

To fix the problem: "sfun_keyboard_input_v1_2 does not exist."
rename the Simulink model to a different name as the s-function.

Greetings,
Fabian

Sav Deb

I get the same message of Chiara, using Matlab 2015b. Any solving?

abdulqader

when I tried to use it in real time code generation in simulink it gives me this message :
The corresponding "'sfun_keyboard_input_v1_2.tlc' file for the MATLAB S-function 'sfun_keyboard_input_v1_2' in block 'finished_senior_dipswitch1/change sound/Keyboard 1' must be located in the current working directory, the MATLAB S-function directory 'C:\Users\NNN\Documents\MATLAB', or the directory 'C:\Users\NNN\Documents\MATLAB\tlc_c'"
I know that the .tlc file is missing plz if you have it can u upload it
thank u

tri bui

Amit

i also have the same problem can somebody resolve this thing"sfun_keyboard_input_v1_2 does not exist. "
Thank you

Chiara

If I save both of your files in the same folder, and I run the model (in Normal mode, is right?), it says sfun_keyboard_input_v1_2 does not exist.
Do you know why?
Thank you

Updates

1.2.0.0

Updated to R2016b with the support for non numeric handles

MATLAB Release Compatibility
Created with R2015b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Acknowledgements

Inspired by: Simulink Keyboard Input