summaryrefslogtreecommitdiff
path: root/skey.c
diff options
context:
space:
mode:
authorknolax <1339802534.kk@gmail.com>2017-12-08 12:16:41 -0500
committerknolax <1339802534.kk@gmail.com>2017-12-08 12:16:41 -0500
commitc7eeb9eeecc6daaf5e7f0e6b54847f9a2caaa2d7 (patch)
treec963d224366fbbe7d69ef9e3cbf01d36cc71dac8 /skey.c
parent831b938ee1148cf02b0be03e5d9514491a47898b (diff)
fixed a typo, has it emmit capslock every second
Diffstat (limited to 'skey.c')
-rw-r--r--skey.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/skey.c b/skey.c
index de255ab..427f3e4 100644
--- a/skey.c
+++ b/skey.c
@@ -46,11 +46,16 @@ int skey_update_thread (void *data) {
}
//a counter for testing prints
int i = 0;
+ int j = 0;
while (1) {
i++;
i = i % 500;
if (!i) {
printk(KERN_INFO "skey: update thread printed to kernel log every 1s\n");
+ //reports the a button pressed
+ input_report_key(skey_dev,KEY_CAPSLOCK,j);
+ input_sync(skey_dev);
+ j = !j;
}
if (USE_GPIO) {
//reads the keyboard
@@ -138,7 +143,7 @@ static int __init skey_init (void) {
// declares the event code and typesthe device emmits
set_bit(EV_KEY, skey_dev->evbit);
set_bit(EV_REL, skey_dev->evbit);
- set_bit(KEY_A, skey_dev.keybit);
+ set_bit(KEY_CAPSLOCK, skey_dev->keybit);
// registers the device
if (input_register_device(skey_dev)) {
input_free_device(skey_dev);