Merge branch 'master' of git://factorcode.org/git/factor

db4
John Benediktsson 2009-02-24 09:35:18 -08:00
commit 7307808375
3 changed files with 14 additions and 15 deletions

View File

@ -104,7 +104,7 @@ SYMBOLS: msg-obj class-name-ptr mouse-captured ;
[ lo-word ] keep hi-word 2array
swap window (>>window-loc) ;
: wm-keydown-codes ( -- key )
CONSTANT: wm-keydown-codes
H{
{ 8 "BACKSPACE" }
{ 9 "TAB" }
@ -132,7 +132,7 @@ SYMBOLS: msg-obj class-name-ptr mouse-captured ;
{ 121 "F10" }
{ 122 "F11" }
{ 123 "F12" }
} ;
}
: key-state-down? ( key -- ? )
GetKeyState 16 bit? ;
@ -155,22 +155,22 @@ SYMBOLS: msg-obj class-name-ptr mouse-captured ;
alt? [ A+ , ] when
] { } make [ empty? not ] keep f ? ;
: exclude-keys-wm-keydown
CONSTANT: exclude-keys-wm-keydown
H{
{ 16 "SHIFT" }
{ 17 "CTRL" }
{ 18 "ALT" }
{ 20 "CAPS-LOCK" }
} ;
}
: exclude-keys-wm-char
! Values are ignored
! Values are ignored
CONSTANT: exclude-keys-wm-char
H{
{ 8 "BACKSPACE" }
{ 9 "TAB" }
{ 13 "RET" }
{ 27 "ESC" }
} ;
}
: exclude-key-wm-keydown? ( n -- ? )
exclude-keys-wm-keydown key? ;

View File

@ -29,14 +29,14 @@ M: world configure-event
! In case dimensions didn't change
relayout-1 ;
: modifiers
CONSTANT: modifiers
{
{ S+ HEX: 1 }
{ C+ HEX: 4 }
{ A+ HEX: 8 }
} ;
: key-codes
}
CONSTANT: key-codes
H{
{ HEX: FF08 "BACKSPACE" }
{ HEX: FF09 "TAB" }
@ -62,7 +62,7 @@ M: world configure-event
{ HEX: FFC4 "F7" }
{ HEX: FFC5 "F8" }
{ HEX: FFC6 "F9" }
} ;
}
: key-code ( keysym -- keycode action? )
dup key-codes at [ t ] [ 1string f ] ?if ;

5
basis/windows/winsock/winsock.factor Normal file → Executable file
View File

@ -257,12 +257,11 @@ TYPEDEF: WSANAMESPACE_INFOW WSANAMESPACE_INFO
TYPEDEF: WSANAMESPACE_INFO* PWSANAMESPACE_INFO
TYPEDEF: WSANAMESPACE_INFO* LPWSANAMESPACE_INFO
: FD_MAX_EVENTS 10 ;
CONSTANT: FD_MAX_EVENTS 10
C-STRUCT: WSANETWORKEVENTS
{ "long" "lNetworkEvents" }
! { { "int" "FD_MAX_EVENTS" } "iErrorCode" } ;
{ { "int" 10 } "iErrorCode" } ;
{ { "int" FD_MAX_EVENTS } "iErrorCode" } ;
TYPEDEF: WSANETWORKEVENTS* PWSANETWORKEVENTS
TYPEDEF: WSANETWORKEVENTS* LPWSANETWORKEVENTS