1. beeps
- Posted by George Walters <gwalters at sc.rr.com> Jul 23, 2004
- 585 views
I'm trying to discover why windows beeps when I "tab" through fields. It does not beep when I "arrow" throught fields and in my code there is no (apparent to me) difference between tabbing and arrowing. Look at this code
procedure keyPressProcessA(integer self, integer processId, sequence arg) integer keyCode, shift
keyCode = arg[1] shift = arg[2]
if keyCode = tab then make tab same as arrows if shift = 0 then keyCode = downArrow else keyCode = upArrow end if end if
keyPressProcessB(self, processId, {keyCode,shift})
end procedure }}}
2. Re: beeps
- Posted by George Walters <gwalters at sc.rr.com> Jul 23, 2004
- 610 views
Well, putting in some dots to indicate missing code ended up deleting the rest of my message so I removed them and here it is. I'm trying to discover why windows beeps when I "tab" through fields. It does not beep when I "arrow" throught fields and in my code there is no (apparent to me) difference between tabbing and arrowing. Look at this code procedure keyPressProcessA(integer self, integer processId, sequence arg) integer keyCode, shift keyCode = arg[1] shift = arg[2] if keyCode = tab then -- make tab same as arrows if shift = 0 then keyCode = downArrow else keyCode = upArrow end if end if keyPressProcessB(self, processId, {keyCode,shift}) end procedure setHandler(Screen, w32HKeyPress, routine_id("keyPressProcessB")) setHandler(Screen, w32HKeyDown, routine_id("keyPressProcessA")) tmp = setTabCodes(0) WinMain({Main,lbt[1]},Normal) I set the code from tabbing to be the same as arrowing and hitting the arrows does not beep but tabbing does....any Idea's?? BTW when beeps occurr what does that mean as far as win32? What is windows trying to tell me? I'm running win32 version 59.1 if that might make any difference. george
3. Re: beeps
- Posted by Mario Steel <eumario at tuscanchat.com> Jul 23, 2004
- 576 views
Brian Broker wrote: > > >George Walters wrote: ><snip> > > >> <>I set the code from tabbing to be the same as arrowing and hitting the >> arrows does not beep but tabbing does....any Idea's?? >> BTW when beeps occurr what does that mean as far as win32? What is >> windows trying to tell me? I'm running win32 version 59.1 if that might >> make any difference. >> >> george > First off, it's not a problem with Win32lib. Though v0.60.1 may have a function that delimits the beep noise. The beep noise is to let ya know, that your doing something, that isn't supported for that control. If you was to put a Single Line Edit (EditText), type something in, then press enter, it'll beep at you, mainly because a Single Line Edit (SLE) doesn't allow returns by standard forming. However, if you was to put in a onKeyPress event for the Edit Text, search for the Return Key (VK_ENTER or VK_RETURN one of the two), and use returnValue(-1), it'll prevent the beeping noise, and actually insert the Return into the SLE ('\n'), though it will appear as a black box. Hope this analogy helps out. Cause I'm pretty sure, that it's just the tabbing effect that's not being supported by the windows control(s) in question. >> <>I'd try the latest release and see if that fixes it. I think it does... >> http://www.users.bigpond.com/ddparnell/euphoria/euphoria.htm >> >> -- Brian > Mario No matter what you write in your code, it comes down to being logic, and only the computer doing as you instructed it to do in your code.
4. Re: beeps
- Posted by George Walters <gwalters at sc.rr.com> Jul 23, 2004
- 563 views
Well, that's exactly what I am trying to do. I have a screen full of SLE's and get beeps tabbing through even though I have tried putting returnValue(-1) when through, as well as other places. I tried 60.1 but it broke a lot of my code. What broke (i'm sure what i was doing was not proper) was that I use groups to dress up a screen but i never put any objects in the group, all objects were in the main screen. Therefore the screen was blank except for the empty group boxes. And 60.1 did not rid me of the beeps. I don't want to really use the groups since you can't tab across them with windows doing the tabbing. I guess i'm stuck. george
5. Re: beeps
- Posted by Don <eunexus at yahoo.com> Jul 23, 2004
- 572 views
George Walters wrote: > > I'm trying to discover why windows beeps when I "tab" through fields. It does > not beep > when I "arrow" throught fields and in my code there is no (apparent to me) > difference > between tabbing and arrowing. Look at this code > > <font color="#330033"></font> > <font color="#0000FF">procedure </font><font > color="#330033">keyPressProcessA(</font><font color="#FF00FF">integer > </font><font color="#330033">self, </font><font color="#FF00FF">integer > </font><font color="#330033">processId, </font><font color="#FF00FF">sequence > </font><font color="#330033">arg)</font> > <font color="#FF00FF"> integer </font><font color="#330033">keyCode, > shift</font> > <font color="#330033"></font> > <font color="#330033"> keyCode = arg[1]</font> > <font color="#330033"> shift = arg[2]</font> > <font color="#330033"></font> > <font color="#0000FF"> if </font><font color="#330033">keyCode = tab > </font><font color="#0000FF">then </font><font color="#FF0055">-- make tab same > as arrows</font> > <font color="#0000FF"> if </font><font color="#330033">shift = 0 > </font><font color="#0000FF">then</font> > <font color="#330033"> keyCode = downArrow</font> > <font color="#0000FF"> else</font> > <font color="#330033"> keyCode = upArrow</font> > <font color="#0000FF"> end if</font> > <font color="#0000FF"> end if</font> > <font color="#330033"></font> > <font color="#330033"> keyPressProcessB(self, processId, </font><font > color="#993333">{</font><font color="#330033">keyCode,shift</font><font > color="#993333">}</font><font color="#330033">)</font> > <font color="#330033"></font> > <font color="#0000FF">end procedure</font> > <font color="#330033"></font> The code snip was nice. But without the rest of the code I cant test it. Mind posting a full short example including controls? I am not currently familiar with what your calling "arrowing". I have always used tabs to change focus. Arrows for me dont work =) sooo, you are likely talking about something else than I am thinking of. I bet however you could subclass the control to get what you want working. Don Phillips - aka Graebel National Instruments mailto: eunexus @ yahoo.com
6. Re: beeps
- Posted by don cole <doncole at pacbell.net> Jul 24, 2004
- 542 views
My question is: I can beep in dos. I can beep in windows but, in windows the speakers must be on. Can I make it beep in windows without the speaker being on? How?
7. Re: beeps
- Posted by Derek Parnell <ddparnell at bigpond.com> Jul 24, 2004
- 600 views
George Walters wrote: > > > Well, putting in some dots to indicate missing code ended up deleting the rest > of my > message so I removed them and here it is. > > > I'm trying to discover why windows beeps when I "tab" through fields. It does > not beep > when I "arrow" throught fields and in my code there is no (apparent to me) > difference > between tabbing and arrowing. Look at this code [code snipped] It is beeping because the TAB key is being processed by the Edit field's default Microsoft process. Normally, win32lib traps the TAB key and tabs around the display, but because you set tabcodes to zero, Win32lib is passing the TAB press to the edit file. I would recommend you do the following... a) Create a new routine to JUST move the focus depending on the UP/DOWN direction and the current focus. b) Set a handler to trap w32HKeyPress and if you get a TAB key, call returnValue(-1). And that's all that this handler does. c) Set a handler to trap w32HKeyDown. Have this translate TAN keys into UP or DOWN depending on the shift key. The if you have an UP or DOWN, call the focus setting routine. Here is some sample code:
include win32lib.ew constant mainwin = create(Window, "main", 0, 0, 0, 200,200,0) constant AA = create(EditText, "AA", mainwin, 10, 10, 150,20,0) constant BB = create(EditText, "BB", mainwin, 10, 40, 150,20,0) constant CC = create(EditText, "CC", mainwin, 10, 70, 150,20,0) constant DD = create(EditText, "DD", mainwin, 10, 110, 150,20,0) constant WhereTo = {AA,BB,CC,DD} procedure MoveCursor(integer self, integer keyCode) integer shift shift = find(self, WhereTo) if keyCode = VK_DOWN then shift += 1 if shift > length(WhereTo) then shift = 0 end if elsif keyCode = VK_UP then shift -= 1 if shift < 1 then shift = 0 end if else shift = 0 end if if shift > 0 then setFocus(WhereTo[shift]) end if end procedure procedure keyPress(integer self, integer processId, sequence arg) VOID = self VOID = processId if arg[1] = VK_TAB then returnValue(-1) end if end procedure procedure keyDown(integer self, integer processId, sequence arg) integer keyCode, shift VOID = processId keyCode = arg[1] shift = arg[2] if keyCode = VK_TAB then -- make tab same as arrows if and_bits(shift,ShiftMask) = 0 then keyCode = VK_DOWN else keyCode = VK_UP end if end if if keyCode = VK_UP or keyCode = VK_DOWN then MoveCursor(self, keyCode) end if end procedure setHandler(Screen, w32HKeyDown, routine_id("keyDown")) setHandler(Screen, w32HKeyPress, routine_id("keyPress")) VOID = setTabCodes(0) WinMain({mainwin,AA}, Normal)
-- Derek Parnell Melbourne, Australia
8. Re: beeps
- Posted by George Walters <gwalters at sc.rr.com> Jul 24, 2004
- 562 views
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> Derek, thanks for the help. beep problem is fixed...<br> <br> Derek Parnell wrote:<br> <blockquote cite="mid1054365097-1463792382-1090652872 at boing.topica.com" type="cite"> George Walters wrote: </pre> <blockquote type="cite"> <pre wrap=""> Well, putting in some dots to indicate missing code ended up deleting the rest of my message so I removed them and here it is. I'm trying to discover why windows beeps when I "tab" through fields. It does not beep when I "arrow" throught fields and in my code there is no (apparent to me) difference between tabbing and arrowing. Look at this code </pre> </blockquote> <pre wrap=""><!----> [code snipped] It is beeping because the TAB key is being processed by the Edit field's default Microsoft process. Normally, win32lib traps the TAB key and tabs around the display, but because you set tabcodes to zero, Win32lib is passing the TAB press to the edit file. I would recommend you do the following... a) Create a new routine to JUST move the focus depending on the UP/DOWN direction and the current focus. </pre> </blockquote> already had one of these<br> <br> <br> <blockquote cite="mid1054365097-1463792382-1090652872 at boing.topica.com" type="cite"> <pre wrap=""> b) Set a handler to trap w32HKeyPress and if you get a TAB key, call returnValue(-1). And that's all that this handler does. </pre> </blockquote> <br> doing this fixed the beeping... thanks<br> <blockquote cite="mid1054365097-1463792382-1090652872 at boing.topica.com" type="cite"> <pre wrap=""> c) Set a handler to trap w32HKeyDown. Have this translate TAN keys into UP or DOWN depending on the shift key. The if you have an UP or DOWN, call the focus setting routine. </pre> </blockquote> moved the tab translate from the keypress to the keydown handler and all is working fine now...<br> <br> <br> <blockquote cite="mid1054365097-1463792382-1090652872 at boing.topica.com" type="cite"> <pre wrap="">Here is some sample code: <eucode> include win32lib.ew constant mainwin = create(Window, "main", 0, 0, 0, 200,200,0) constant AA = create(EditText, "AA", mainwin, 10, 10, 150,20,0) constant BB = create(EditText, "BB", mainwin, 10, 40, 150,20,0) constant CC = create(EditText, "CC", mainwin, 10, 70, 150,20,0) constant DD = create(EditText, "DD", mainwin, 10, 110, 150,20,0) constant WhereTo = {AA,BB,CC,DD} procedure MoveCursor(integer self, integer keyCode) integer shift shift = find(self, WhereTo) if keyCode = VK_DOWN then shift += 1 if shift > length(WhereTo) then shift = 0 end if elsif keyCode = VK_UP then shift -= 1 if shift < 1 then shift = 0 end if else shift = 0 end if if shift > 0 then setFocus(WhereTo[shift]) end if end procedure procedure keyPress(integer self, integer processId, sequence arg) VOID = self VOID = processId if arg[1] = VK_TAB then returnValue(-1) end if end procedure procedure keyDown(integer self, integer processId, sequence arg) integer keyCode, shift VOID = processId keyCode = arg[1] shift = arg[2] if keyCode = VK_TAB then -- make tab same as arrows if and_bits(shift,ShiftMask) = 0 then keyCode = VK_DOWN else keyCode = VK_UP end if end if if keyCode = VK_UP or keyCode = VK_DOWN then MoveCursor(self, keyCode) end if end procedure setHandler(Screen, w32HKeyDown, routine_id("keyDown")) setHandler(Screen, w32HKeyPress, routine_id("keyPress")) VOID = setTabCodes(0) WinMain({mainwin,AA}, Normal) </eucode> </pre> </blockquote> </body> </html>
9. Re: beeps
- Posted by George Walters <gwalters at sc.rr.com> Jul 24, 2004
- 568 views
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> Well Derek, although it stopped the beeping tab key the shift tab still beeps. How could I solve that?<br> <br> george<br> <br> Derek Parnell wrote: <blockquote cite="mid1054365097-1463792382-1090652872 at boing.topica.com" type="cite"> George Walters wrote: </pre> <blockquote type="cite"> <pre wrap=""> Well, putting in some dots to indicate missing code ended up deleting the rest of my message so I removed them and here it is. I'm trying to discover why windows beeps when I "tab" through fields. It does not beep when I "arrow" throught fields and in my code there is no (apparent to me) difference between tabbing and arrowing. Look at this code </pre> </blockquote> <pre wrap=""><!----> [code snipped] It is beeping because the TAB key is being processed by the Edit field's default Microsoft process. Normally, win32lib traps the TAB key and tabs around the display, but because you set tabcodes to zero, Win32lib is passing the TAB press to the edit file. I would recommend you do the following... a) Create a new routine to JUST move the focus depending on the UP/DOWN direction and the current focus. b) Set a handler to trap w32HKeyPress and if you get a TAB key, call returnValue(-1). And that's all that this handler does. c) Set a handler to trap w32HKeyDown. Have this translate TAN keys into UP or DOWN depending on the shift key. The if you have an UP or DOWN, call the focus setting routine. Here is some sample code: <eucode> include win32lib.ew constant mainwin = create(Window, "main", 0, 0, 0, 200,200,0) constant AA = create(EditText, "AA", mainwin, 10, 10, 150,20,0) constant BB = create(EditText, "BB", mainwin, 10, 40, 150,20,0) constant CC = create(EditText, "CC", mainwin, 10, 70, 150,20,0) constant DD = create(EditText, "DD", mainwin, 10, 110, 150,20,0) constant WhereTo = {AA,BB,CC,DD} procedure MoveCursor(integer self, integer keyCode) integer shift shift = find(self, WhereTo) if keyCode = VK_DOWN then shift += 1 if shift > length(WhereTo) then shift = 0 end if elsif keyCode = VK_UP then shift -= 1 if shift < 1 then shift = 0 end if else shift = 0 end if if shift > 0 then setFocus(WhereTo[shift]) end if end procedure procedure keyPress(integer self, integer processId, sequence arg) VOID = self VOID = processId if arg[1] = VK_TAB then returnValue(-1) end if end procedure procedure keyDown(integer self, integer processId, sequence arg) integer keyCode, shift VOID = processId keyCode = arg[1] shift = arg[2] if keyCode = VK_TAB then -- make tab same as arrows if and_bits(shift,ShiftMask) = 0 then keyCode = VK_DOWN else keyCode = VK_UP end if end if if keyCode = VK_UP or keyCode = VK_DOWN then MoveCursor(self, keyCode) end if end procedure setHandler(Screen, w32HKeyDown, routine_id("keyDown")) setHandler(Screen, w32HKeyPress, routine_id("keyPress")) VOID = setTabCodes(0) WinMain({mainwin,AA}, Normal) </eucode> </pre> </blockquote> </body> </html>
10. Re: beeps
- Posted by Mario Steel <eumario at tuscanchat.com> Jul 24, 2004
- 578 views
George Walters wrote: > > > Well Derek, although it stopped the beeping tab key the shift tab > still beeps. How could I solve that? > > george You should do the same with shift tab events, as you do with the normal tab, and up/down keys. Remember to check shift or arg[2] for the and_bits(shift,ShiftMask). Also be sure to use returnValue(-1). It tells Win32lib to tell windows it's proccessed the event, and that it doesn't need to be bothered with doing anything else with that event. L8ers, Mario
11. Re: beeps
- Posted by "Wolf" <wolfritz at king.igs.net> Jul 24, 2004
- 575 views
If you can beep in DOS without the speakers on, using this might work in win32lib. zBeep = registerw32Function(user32, "MessageBeep", {C_INT},C_INT) ..and just call the function to... beep. ..dunno if 'user32' has become 'w32w32w32w32user32' :( > I can beep in dos. I can beep in windows but, in windows > the speakers must be on. Can I make it beep in windows without the speaker > being on? How?