Hi Renny,
Below mentioned solution covers both the possible use-cases.
- There are multiple ways following which we can define/use the JavaScript in a screen. As per my understanding w.r.t the mentioned use-case, I would suggest you to try with the below mentioned solution..
- Define an Expression widget to the Screen's Footer placeholder section as shown below

- Referring from the below mentioned Code snippet - Define/use anyone of the JavaScript code snippet within the introduced Expression widget as per the requirement.
Case 1) Is it that you are trying to disable/restrict the keyboard input for a specific Input control?
"<script>
eventTarget = document.querySelector('#" + CommentInpt.Id + "');
eventTarget.addEventListener('keydown', event => {
event.preventDefault();
});
</script>"
Case 2) Is it that you want to disable the keyboard input for the entire screen?
"<script>
document.onkeydown = function (e) {
return false;
}
</script>"
Hope this helps you!
Kind regards,
Benjith Sam