SRL Archive - S.M.A.R.T.

SMART Enter Key Not Working


Dmox

2015-05-16 13:27:20

On my script I need it to send an enter key to the SMART client and it can't seem to do this. I am able to send the enter key without SMART, but whenever I use SMART it just won't work. The arrow keys seem to work fine though so I am assuming it's just a problem with the enter key.

I've tried 108, 13, and vk_return in the KeyDown(); and KeyPress(); commands but nothing seems to work.

Please let me know if you have any idea why it's doing this or a solution to it. Thanks!

KeepBotting

2015-05-16 13:29:46

That keycode is different for SMART, use 10.

https://github.com/SRL/SRL-6/blob/84340b8fa046c5dc44fed842171f9cda830f23d4/lib/core/text.simba#L219

You can see that SRL-6's function does the same. <Enter> is usually 13, but when using SMART, it's 10. I don't know why, it's the only one that's like that.

Brandon

2015-05-16 23:38:06

From: KeepBotting
That keycode is different for SMART, use 10.

https://github.com/SRL/SRL-6/blob/84340b8fa046c5dc44fed842171f9cda830f23d4/lib/core/text.simba#L219

You can see that SRL-6's function does the same. <Enter> is usually 13, but when using SMART, it's 10. I don't know why, it's the only one that's like that.


Java defined VK_RETURN as "10" aka New-Line/Line-Feed.
WinAPI defines it as "13" aka Carriage-Return.
Firefox defines it as "DOM_VK_RETURN = 13" and "DOM_VK_ENTER = 14".

All of this confusion is from the old type-writer days.

grats

2015-05-17 00:59:13

From: Brandon
Java defined VK_RETURN as "10" aka New-Line/Line-Feed.
WinAPI defines it as "13".
Firefox defines it as "DOM_VK_RETURN = 13" and "DOM_VK_ENTER = 14".

All of this confusion is from the old type-writer days.


hey that's where qwerty is from too
at least we don't use it today.. oh wait
well at least it isn't one of the worst keyboard layouts for speed & ease of use/learning.. oh wait

nvm we're all doomed

KeepBotting

2015-05-17 06:46:56

From: Brandon
Java defined VK_RETURN as "10" aka New-Line/Line-Feed.
WinAPI defines it as "13".
Firefox defines it as "DOM_VK_RETURN = 13" and "DOM_VK_ENTER = 14".

All of this confusion is from the old type-writer days.
Ah, thanks. That's pretty interesting. I knew typewriters gave way to keyboards, but I didn't know they had that much of an influence!

From: grats
hey that's where qwerty is from too
at least we don't use it today.. oh wait
well at least it isn't one of the worst keyboard layouts for speed & ease of use/learning.. oh wait

nvm we're all doomed

Yeah, I ready somewhere that QWERTY/AZERTY keyboard layouts are actually the least efficient to type with, because the QWERTY layout was originally used to spread keys that were commonly used together further apart. This was done so typewriters would jam less often due to rapid keystrokes.

Brandon

2015-05-17 08:53:49

From: grats
hey that's where qwerty is from too
at least we don't use it today.. oh wait
well at least it isn't one of the worst keyboard layouts for speed & ease of use/learning.. oh wait

nvm we're all doomed


Lol'd.


From: KeepBotting
Ah, thanks. That's pretty interesting. I knew typewriters gave way to keyboards, but I didn't know they had that much of an influence!


Yeah, I ready somewhere that QWERTY/AZERTY keyboard layouts are actually the least efficient to type with, because the QWERTY layout was originally used to spread keys that were commonly used together further apart. This was done so typewriters would jam less often due to rapid keystrokes.



History:

Type-writer logic is pretty much used in all of today's keyboards. The enter button does exactly what a type-writer used to do (two instructions/twists).

\r\n or \n\r is what a type-writer does (13,10 or 10,13).. It means: First create a new line (push the paper up) and then go to the beginning of the next line (push the paper right).

The \n is the line-feed aka "10" and that one creates the new line. The \r is carriage-return aka "13" and it goes to the beginning of the new line. Without both, when you press enter, your cursor would be right under its position on the previous line until you move the cursor left.


Today:

Windows still use \r\n.
Linux use \n.
Mac (old) use \r.
Mac (new) use \n.
Internet uses \r\n (IE: Socket & communication protocols [HTTP, TCP, UDP, SMTP, POP3, et al]).

Absolutely painful. You're right about qwerty and the slowing down so it won't break type-writers.