Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

scan codes and virtual keys ! What is the difference ?



  • Please log in to reply
6 replies to this topic
A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

And what should I use ?

 

 

As far as I understand, VK are more like numbers that denote a key's position on a keyboard physically . 

SC look to be the real keys number identifiers that symbolise what a key does and have nothing to do with their position.

 

 

So, what should I do to make a hotkey (say Ctrl+A) that would be used in all the keyboards of the world ??

 

 

Thanks for any help .


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


Hamlet
  • Members
  • 302 posts
  • Last active: Mar 23 2014 03:37 PM
  • Joined: 22 Jan 2009

Definately, Choose the Scan Codes !!



A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

Definately, Choose the Scan Codes !!

Scan codes and VKs work alike. 

$^v::
	;Send, ^{sc02f} 	;-works
	;Send, ^{vk56} 		;-works
	;Send ^v 		;- fails
	return

Now the question which one is more reliable than the other.


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


Linear Spoon
  • Members
  • 842 posts
  • Last active: Sep 29 2015 03:56 AM
  • Joined: 29 Oct 2011
✓  Best Answer

Scan codes are dependent on your hardware and might differ from computer to computer. Virtual keys are mapped to be the same keys on any system.


Join us at the new forum - http://www.ahkscript.org/

 


A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

Scan codes are dependent on your hardware and might differ from computer to computer. Virtual keys are mapped to be the same keys on any system.

Thank you for sharing your knowledge . Is there a relative link through which I can learn more about Virtual keys ?

 

PS -  Is ^{vk56} the shortcut for paste in all the keyboard layouts ? 


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan


Linear Spoon
  • Members
  • 842 posts
  • Last active: Sep 29 2015 03:56 AM
  • Joined: 29 Oct 2011

Here's a list of Windows virtual keys: http://www.kbdedit.c...el_vk_list.html

 

I don't think there is really a lot to research here. It's just numeric constants for a list of keys, much like ascii is a list of constants for characters.

 

I honestly haven't tried automation in any non-english keyboard layout, so I can't say for sure if that will work.


Join us at the new forum - http://www.ahkscript.org/

 


A v i
  • Members
  • 1323 posts
  • Last active: Nov 14 2015 06:56 PM
  • Joined: 30 Jan 2013

Here's a list of Windows virtual keys: http://www.kbdedit.c...el_vk_list.html
 
I don't think there is really a lot to research here. It's just numeric constants for a list of keys, much like ascii is a list of constants for characters.
 
I honestly haven't tried automation in any non-english keyboard layout, so I can't say for sure if that will work.

Thank you , btw I found a MSDN link which lists all the keys . Reading all around in multiple topics , I feel you are right and that virtual keys are more universal than scan-codes. 


Now a CS Undergrad. | My WebsiteAutohotkey Scripts | Softwares

Telegram me : @aviaryan