[futurebasic] Re: Does FB^3 add an element

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : January 2001 : Group Archive : Group : All Groups

From: Ken Shmidheiser <k.shmidheiser@...>
Date: Sun, 7 Jan 2001 15:18:29 -0500
Joe wrote:

>Hi Ken,
>
>In running your latest on my iMac, I discovered that the F9 through F12 keys
>do not register as FKeys - or anything at all - on your Demo.  Actually, I've
>been having some problems with these keys, hitting them accidentally sometimes
>when I strike the keys right below them - finger nails too long < smile >.
>When I do, the F9 Key (I'm pretty sure) emits a strange noise, and the F12
>does the camera taking a picture bit, after which my iMac stops to a crawl
>(when I am on Netscape).  I have to reboot in order to restore normal speed.
>I mean like - 20 or 30 seconds between times that I can do anything, access a
>menu or whatever, and it goes back immediately into the stall mode - so it is
>time consuming to even Quit and, when I get to the Desktop, selecting ShutDown
>OR Restart balks as well.  I have to use the Abort Key combination, or - on an
>occasion or two - actually pull the plug.
>
>Anyone else encounter such problems?
>
>TIA,
>
>Joe Wilkins


Joe,

Are you running any macro or keyboard mapping programs like Quick 
Keys, KeyQuencer, OneClick, TypeItForMe, SwitchIt, etc.? Any of these 
would intercept the low-level keystroke event before FB^3 sees it in 
ON EVENT that I use to capture the Function keys in this demo.

The built-in Mac screen shot utility macros are Shift-Command-3 for 
full screen, and Shift-Command-4 for screen shot cropping tool, so I 
don't think this code should be triggering them. (This works fine 
under OS 8.1 which I am still using on my development machine.)

I believe you do some Spanish translation. Are you using standard 
English keyboard mapping or another derivative?

If you would, please run this code snippet and let me know if F13-F15 
still give you problems. This code works for most keys with the 
exception of modifiers.

Ken


Please adjust for e-mail line breaks:

'------------ BEGIN FB^3 CODE ------------

_testFunctionKeys  = _false

LOCAL FN FindFunctionKey (vKeyCode%)
DIM key$,functionKeyPressed%
functionKeyPressed% = _false
COMPILE LONG IF _testFunctionKeys
SELECT vKeyCode%'show us which key was pressed
CASE 122,120,99,118,96,97,98,100,101,109,103,111,105,107,113
functionKeyPressed% = vKeyCode%
CASE 114,115,116,117,119,121'special keys (home, help, etc.)
functionKeyPressed% = vKeyCode%
END SELECT
COMPILE XELSE
SELECT vKeyCode%'Which key was pressed
CASE 122   : key$ = "F1"'FN #1
CASE 120   : key$ = "F2"'FN #2
CASE 99    : key$ = "F3"'FN #3
CASE 118   : key$ = "F4"'FN #4
CASE 96    : key$ = "F5"'FN #5
CASE 97    : key$ = "F6"'FN #6
CASE 98    : key$ = "F7"'FN #7
CASE 100   : key$ = "F8"'FN #8
CASE 101   : key$ = "F9"'FN #9
CASE 109   : key$ = "F10"'FN #10
CASE 103   : key$ = "F11"'FN #11
CASE 111   : key$ = "F12"'FN #12
CASE 105   : key$ = "F13"'FN #13
CASE 107   : key$ = "F14"'FN #14
CASE 113   : key$ = "F15"'FN #15
CASE 114   : key$ = "Help"'help
CASE 115   : key$ = "Home"'home
CASE 116   : key$ = "Page Up"'page up
CASE 121   : key$ = "Page Down"'page down
CASE 119   : key$ = "End"'end
CASE 117   : key$ = "Delete Forward"'delete forward
CASE ELSE  : key$ = ""'all other keys
END SELECT
LONG IF LEN(key$) > 0
PRINT "Key Pressed: ";key$
functionKeyPressed% = _true
END IF
COMPILE END IF
END FN = functionKeyPressed%

LOCAL FN doEvent
DIM vKeyCode%
SELECT {EVENT}
CASE _keyDwnEvt
vKeyCode% = PEEK (EVENT + _evtMessage + 2)
LONG IF FN FindFunctionKey (vKeyCode%) = 0
PRINT "Key Pressed: ";CHR$(PEEK (EVENT + _evtMessage + 3))
END IF
CASE ELSE
END SELECT
END FN

Print "Press keys to test"
PRINT "Click mouse to end..."

ON EVENT FN doEvent
DO
HANDLEEVENTS
UNTIL FN BUTTON

'--------- END CODE ----------