Constant VK of ² [Resolved]

Just starting out? Need help? Post your questions and find answers here.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Constant VK of ² [Resolved]

Post by Kwai chang caine »

Hello at all

Someone know the constant VK of the little 2 (²) in the top left corner of the keyboard ??
I search since one hour and not found :oops:

Have a good day
Last edited by Kwai chang caine on Fri Feb 10, 2012 1:31 pm, edited 1 time in total.
ImageThe happiness is a road...
Not a destination
Torp
User
User
Posts: 82
Joined: Fri Apr 01, 2005 11:29 am

Re: Constant VK of ²

Post by Torp »

I do not have the answer but, "The little 2" is only on french keyboard, no ? On "QWERTY" the keyboard is a "~". :wink:
Last edited by Torp on Thu Feb 09, 2012 6:38 pm, edited 1 time in total.
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Re: Constant VK of ²

Post by Foz »

And I have a key with three characters next to the [1] key: ` ¬ ¦
And in the top left is [Esc]

(uk keyboard)
User avatar
Shield
Addict
Addict
Posts: 1021
Joined: Fri Jan 21, 2011 8:25 am
Location: 'stralia!
Contact:

Re: Constant VK of ²

Post by Shield »

On my keyboard it's #VK_OEM_2. But do note that the location of the OEM keys can vary
depending on what keyboard layout you use.
Image
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Constant VK of ²

Post by Kwai chang caine »

Thanks a lot for your answers

It's true, i have forgotten this history of different keyboards.... :oops:
In fact like you are all of my familly, i forget we not speak and write with the same tools :lol:
I do not have the answer but, "The little 2" is only on french keyboard, no ? On "QWERTY" the keyboard is a "~".
Apparently yes..if you say that....i don't know..me i always have french keyboard :lol:
Me the ~ is under the "2" :D
And in the top left is [Esc]
I was wrong, in my explanation :oops:
In fact, when i say the top left, it's not the top of the top :lol:
But the top of the letter touch, under the ESC, a side of the 1 and the TAB at the "TOP" left :mrgreen:
Image

On my keyboard it's #VK_OEM_2. But do note that the location of the OEM keys can vary
depending on what keyboard layout you use.
Thanks i see if it's the good constant 8)

@AT ALL
Perhaps they are a code who detect all the key pressed ans give the CONSTANT_VK ???

I have search and found several code, but he give the ASCII code or the evenement Keyboard down or UP :(
ImageThe happiness is a road...
Not a destination
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4954
Joined: Sun Apr 12, 2009 6:27 am

Re: Constant VK of ²

Post by RASHAD »

Hi KCC
I am not sure but try #VK_NUMPAD0
Egypt my love
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Constant VK of ²

Post by Kwai chang caine »

Hello RASHAD :D
No more chance :(
The #VK_NUMPAD0 works only with the "0" of the NUMPAD :(

Code: Select all

Repeat
 
 If GetAsyncKeyState_(#VK_CONTROL) & 32768 
  Debug "#VK_CONTROL"
 EndIf
 
 If GetAsyncKeyState_(#VK_OEM_2) & 32768
  Debug "#VK_OEM_2"
  Debug ""
 EndIf
 
 If GetAsyncKeyState_(#VK_NUMPAD0) & 32768
  Debug "#VK_NUMPAD0"
  Debug ""
 EndIf
 
 Delay(200)
 
ForEver 
@SHIELD
I try also #VK_OEM_2, and that's not works
I have even not find the key who works with this constant :(

It's really not simple the Constant_VK :?
ImageThe happiness is a road...
Not a destination
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4954
Joined: Sun Apr 12, 2009 6:27 am

Re: Constant VK of ²

Post by RASHAD »

Try

Code: Select all

Repeat

If GetAsyncKeyState_(#VK_CONTROL) & 32768 
  Debug "#VK_CONTROL"
EndIf

If GetAsyncKeyState_(#VK_OEM_3) & 32768
  Debug "#VK_OEM_3"
  Debug ""
EndIf

If GetAsyncKeyState_(#VK_NUMPAD0) & 32768
  Debug "#VK_NUMPAD0"
  Debug ""
EndIf

Delay(200)

ForEver 


VK Codes

Code: Select all

#VK_LBUTTON = $1
#VK_RBUTTON = $2
#VK_CANCEL = $3
#VK_MBUTTON = $4
#VK_BACK = $8
#VK_TAB = $9
#VK_CLEAR = $C
#VK_RETURN = $D
#VK_SHIFT = $10
#VK_CONTROL = $11
#VK_MENU = $12
#VK_PAUSE = $13
#VK_CAPITAL = $14
#VK_ESCAPE = $1B
#VK_SPACE = $20
#VK_PRIOR = $21
#VK_NEXT = $22
#VK_END = $23
#VK_HOME = $24
#VK_LEFT = $25
#VK_UP = $26
#VK_RIGHT = $27
#VK_DOWN = $28
#VK_SELECT = $29
#VK_PRINT = $2A
#VK_EXECUTE = $2B
#VK_SNAPSHOT = $2C
#VK_INSERT = $2D
#VK_DELETE = $2E
#VK_HELP = $2F
#VK_0 = $30
#VK_1 = $31
#VK_2 = $32
#VK_3 = $33
#VK_4 = $34
#VK_5 = $35
#VK_6 = $36
#VK_7 = $37
#VK_8 = $38
#VK_9 = $39
#VK_A = $41
#VK_B = $42
#VK_C = $43
#VK_D = $44
#VK_E = $45
#VK_F = $46
#VK_G = $47
#VK_H = $48
#VK_I = $49
#VK_J = $4A
#VK_K = $4B
#VK_L = $4C
#VK_M = $4D
#VK_N = $4E
#VK_O = $4F
#VK_P = $50
#VK_Q = $51
#VK_R = $52
#VK_S = $53
#VK_T = $54
#VK_U = $55
#VK_V = $56
#VK_W = $57
#VK_X = $58
#VK_Y = $59
#VK_Z = $5A
#VK_STARTKEY = $5B
#VK_CONTEXTKEY = $5D
#VK_NUMPAD0 = $60
#VK_NUMPAD1 = $61
#VK_NUMPAD2 = $62
#VK_NUMPAD3 = $63
#VK_NUMPAD4 = $64
#VK_NUMPAD5 = $65
#VK_NUMPAD6 = $66
#VK_NUMPAD7 = $67
#VK_NUMPAD8 = $68
#VK_NUMPAD9 = $69
#VK_MULTIPLY = $6A
#VK_ADD = $6B
#VK_SEPARATOR = $6C
#VK_SUBTRACT = $6D
#VK_DECIMAL = $6E
#VK_DIVIDE = $6F
#VK_F1 = $70
#VK_F2 = $71
#VK_F3 = $72
#VK_F4 = $73
#VK_F5 = $74
#VK_F6 = $75
#VK_F7 = $76
#VK_F8 = $77
#VK_F9 = $78
#VK_F10 = $79
#VK_F11 = $7A
#VK_F12 = $7B
#VK_F13 = $7C
#VK_F14 = $7D
#VK_F15 = $7E
#VK_F16 = $7F
#VK_F17 = $80
#VK_F18 = $81
#VK_F19 = $82
#VK_F20 = $83
#VK_F21 = $84
#VK_F22 = $85
#VK_F23 = $86
#VK_F24 = $87
#VK_NUMLOCK = $90
#VK_OEM_SCROLL = $91
#VK_OEM_PLUS = $BB    
#VK_OEM_COMMA = $BC   "<"
#VK_OEM_MINUS = $BD   "_"
#VK_OEM_PERIOD = $BE  ">"
#VK_OEM_1 = $BA       ";"
#VK_OEM_2 = $BF       "?"
#VK_OEM_3 = $C0       "~"
#VK_OEM_4 = $DB       "{"
#VK_OEM_5 = $DC       "|"
#VK_OEM_6 = $DD       "}"
#VK_OEM_7 = $DE       """
#VK_OEM_8 = $DF
#VK_OEM_102 = $E2     "/"
#VK_ICO_F17 = $E0
#VK_ICO_F18 = $E1
#VK_ICO_HELP = $E3
#VK_ICO_00 = $E4
#VK_ICO_CLEAR = $E6
#VK_OEM_RESET = $E9
#VK_OEM_JUMP = $EA
#VK_OEM_PA1 = $EB
#VK_OEM_PA2 = $EC
#VK_OEM_PA3 = $ED
#VK_OEM_WSCTRL = $EE
#VK_OEM_CUSEL = $EF
#VK_OEM_ATTN = $F0
#VK_OEM_FINNISH = $F1
#VK_OEM_COPY = $F2
#VK_OEM_AUTO = $F3
#VK_OEM_ENLW = $F4
#VK_OEM_BACKTAB = $F5
#VK_ATTN = $F6
#VK_CRSEL = $F7
#VK_EXSEL = $F8
#VK_EREOF = $F9
#VK_PLAY = $FA
#VK_ZOOM = $FB
#VK_NONAME = $FC
#VK_PA1 = $FD
#VK_OEM_CLEAR = $FE

Egypt my love
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Constant VK of ²

Post by Kwai chang caine »

That's not works too :(

So i have try this code

Code: Select all

Enumeration
  #Form0
EndEnumeration

OpenWindow(#Form0, 216, 0, 600, 300, "New window ( 0 )",  #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
    
Repeat 

 Select WaitWindowEvent() 
 
  Case #WM_KEYDOWN 
   Debug "#KEYDOWN: " + Str(EventwParam()) 
   Debug "#KEYDOWN: " + Str(EventlParam()) 
 
 EndSelect 

ForEver
And the result is
#KEYDOWN: 222
#KEYDOWN: 2686977
How i can convert this result in Constant_VK ??
ImageThe happiness is a road...
Not a destination
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4954
Joined: Sun Apr 12, 2009 6:27 am

Re: Constant VK of ²

Post by RASHAD »

222 = $DE = #VK_OEM_7
Egypt my love
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Constant VK of ² [Resolved]

Post by Kwai chang caine »

Thanks a lot RASHAD...you are an angel 8)

Have the very better day of the world :D
ImageThe happiness is a road...
Not a destination
Post Reply