Add examples for keyboard input.
[libmalice.git] / demo-input-char.c
diff --git a/demo-input-char.c b/demo-input-char.c
new file mode 100644 (file)
index 0000000..4bd2af9
--- /dev/null
@@ -0,0 +1,17 @@
+#include "libmalice.h"
+
+int lmMain(void)
+{
+  char c;
+
+  lmPrintString("This demo tests keyboard input for single characters.\n");
+
+  lmPrintString("Enter a letter and press return: ");
+  c = lmReadChar();
+  lmPrintString("You entered the letter ");
+  lmPrintChar(c);
+  lmPrintChar('.');
+  lmPrintChar('\n');
+
+  return 0;
+}