Can Operating Systems handle shift, ctrl and alt key signals separate from the keyboard?
The basic problem is this: I have a mini keyboard I'm using for a Raspberry Pi project, and since there is only one shift, ctrl and alt key apiece, that means combinations on the left side of the keyboard like shift-A and ctrl-C are kind of awkward to pull off without dropping it.
My intended solution is to add a separate button to simulate a second shift key. With the RPi and some very basic electronics and programming experience, this is fairly simple in theory. At least for most keys. But since the shift key is kind of a "modifier" key...
The question is, do Operating Systems handle each keypress separately or is it the keyboard's job to send a capital A when the user pushes shift-A? Can I use a second input to simulate a shift key and then push the A key on the keyboard to have the Operating System print a capital A? A general answer is appreciated, but if it depends on the Operating System, the OS in question is Raspbian Stretch, based on Debian Stretch.
keyboard operating-systems io shift
add a comment |
The basic problem is this: I have a mini keyboard I'm using for a Raspberry Pi project, and since there is only one shift, ctrl and alt key apiece, that means combinations on the left side of the keyboard like shift-A and ctrl-C are kind of awkward to pull off without dropping it.
My intended solution is to add a separate button to simulate a second shift key. With the RPi and some very basic electronics and programming experience, this is fairly simple in theory. At least for most keys. But since the shift key is kind of a "modifier" key...
The question is, do Operating Systems handle each keypress separately or is it the keyboard's job to send a capital A when the user pushes shift-A? Can I use a second input to simulate a shift key and then push the A key on the keyboard to have the Operating System print a capital A? A general answer is appreciated, but if it depends on the Operating System, the OS in question is Raspbian Stretch, based on Debian Stretch.
keyboard operating-systems io shift
add a comment |
The basic problem is this: I have a mini keyboard I'm using for a Raspberry Pi project, and since there is only one shift, ctrl and alt key apiece, that means combinations on the left side of the keyboard like shift-A and ctrl-C are kind of awkward to pull off without dropping it.
My intended solution is to add a separate button to simulate a second shift key. With the RPi and some very basic electronics and programming experience, this is fairly simple in theory. At least for most keys. But since the shift key is kind of a "modifier" key...
The question is, do Operating Systems handle each keypress separately or is it the keyboard's job to send a capital A when the user pushes shift-A? Can I use a second input to simulate a shift key and then push the A key on the keyboard to have the Operating System print a capital A? A general answer is appreciated, but if it depends on the Operating System, the OS in question is Raspbian Stretch, based on Debian Stretch.
keyboard operating-systems io shift
The basic problem is this: I have a mini keyboard I'm using for a Raspberry Pi project, and since there is only one shift, ctrl and alt key apiece, that means combinations on the left side of the keyboard like shift-A and ctrl-C are kind of awkward to pull off without dropping it.
My intended solution is to add a separate button to simulate a second shift key. With the RPi and some very basic electronics and programming experience, this is fairly simple in theory. At least for most keys. But since the shift key is kind of a "modifier" key...
The question is, do Operating Systems handle each keypress separately or is it the keyboard's job to send a capital A when the user pushes shift-A? Can I use a second input to simulate a shift key and then push the A key on the keyboard to have the Operating System print a capital A? A general answer is appreciated, but if it depends on the Operating System, the OS in question is Raspbian Stretch, based on Debian Stretch.
keyboard operating-systems io shift
keyboard operating-systems io shift
asked Dec 27 '18 at 16:40
DevsmanDevsman
1104
1104
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Most modern keyboards are interfaced as USB HID devices; there are exceptions, but your case with a raspberry pi is clearly USB.
In the case of a USB keyboard, the state of modifier keys is communicated by a separate bitmask of states sent along when reporting ordinary keys, see for example https://wiki.osdev.org/USB_Human_Interface_Devices for the specific bits and keys. (This is different from PS/2 keyboards, where modifier keys had their own scan codes).
If you can find the code which interprets events and understand how it uses the modifier bits, you could modify the logic to look at other things as well. You could also potentially just bitwise OR in your own alternate input states on top of the reported modifier keys (since a "1" indicates a pressed key).
For some simpler type of keyboards using keyswitches, you might also be able to wire in a separate pushbutton in parallel with an existing modifier key; but this could be tricky.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1388163%2fcan-operating-systems-handle-shift-ctrl-and-alt-key-signals-separate-from-the-k%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Most modern keyboards are interfaced as USB HID devices; there are exceptions, but your case with a raspberry pi is clearly USB.
In the case of a USB keyboard, the state of modifier keys is communicated by a separate bitmask of states sent along when reporting ordinary keys, see for example https://wiki.osdev.org/USB_Human_Interface_Devices for the specific bits and keys. (This is different from PS/2 keyboards, where modifier keys had their own scan codes).
If you can find the code which interprets events and understand how it uses the modifier bits, you could modify the logic to look at other things as well. You could also potentially just bitwise OR in your own alternate input states on top of the reported modifier keys (since a "1" indicates a pressed key).
For some simpler type of keyboards using keyswitches, you might also be able to wire in a separate pushbutton in parallel with an existing modifier key; but this could be tricky.
add a comment |
Most modern keyboards are interfaced as USB HID devices; there are exceptions, but your case with a raspberry pi is clearly USB.
In the case of a USB keyboard, the state of modifier keys is communicated by a separate bitmask of states sent along when reporting ordinary keys, see for example https://wiki.osdev.org/USB_Human_Interface_Devices for the specific bits and keys. (This is different from PS/2 keyboards, where modifier keys had their own scan codes).
If you can find the code which interprets events and understand how it uses the modifier bits, you could modify the logic to look at other things as well. You could also potentially just bitwise OR in your own alternate input states on top of the reported modifier keys (since a "1" indicates a pressed key).
For some simpler type of keyboards using keyswitches, you might also be able to wire in a separate pushbutton in parallel with an existing modifier key; but this could be tricky.
add a comment |
Most modern keyboards are interfaced as USB HID devices; there are exceptions, but your case with a raspberry pi is clearly USB.
In the case of a USB keyboard, the state of modifier keys is communicated by a separate bitmask of states sent along when reporting ordinary keys, see for example https://wiki.osdev.org/USB_Human_Interface_Devices for the specific bits and keys. (This is different from PS/2 keyboards, where modifier keys had their own scan codes).
If you can find the code which interprets events and understand how it uses the modifier bits, you could modify the logic to look at other things as well. You could also potentially just bitwise OR in your own alternate input states on top of the reported modifier keys (since a "1" indicates a pressed key).
For some simpler type of keyboards using keyswitches, you might also be able to wire in a separate pushbutton in parallel with an existing modifier key; but this could be tricky.
Most modern keyboards are interfaced as USB HID devices; there are exceptions, but your case with a raspberry pi is clearly USB.
In the case of a USB keyboard, the state of modifier keys is communicated by a separate bitmask of states sent along when reporting ordinary keys, see for example https://wiki.osdev.org/USB_Human_Interface_Devices for the specific bits and keys. (This is different from PS/2 keyboards, where modifier keys had their own scan codes).
If you can find the code which interprets events and understand how it uses the modifier bits, you could modify the logic to look at other things as well. You could also potentially just bitwise OR in your own alternate input states on top of the reported modifier keys (since a "1" indicates a pressed key).
For some simpler type of keyboards using keyswitches, you might also be able to wire in a separate pushbutton in parallel with an existing modifier key; but this could be tricky.
edited Dec 27 '18 at 17:06
answered Dec 27 '18 at 17:00
Chris StrattonChris Stratton
31017
31017
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1388163%2fcan-operating-systems-handle-shift-ctrl-and-alt-key-signals-separate-from-the-k%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown