FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour desativar somente o teclado numérico...
Posts: 1
Joined: Tue Mar 06, 2007 02:42 PM
desativar somente o teclado numérico...
Posted: Thu Oct 08, 2015 12:19 AM

Como desabilitar o teclado numérico sem desabilitar a leitora de código de barras?
alguĂ©m pode dar uma mĂŁozinha aĂȘ?

Experimentei o codigo abaixo:
For i=96 to 105 // 0..9 - ok
SetKey( i, { || NIL } )
Next
mas desabilita a eitora de codigo de barras...
alguma ajuda?

Posts: 346
Joined: Mon Oct 05, 2009 03:35 PM
Re: desativar somente o teclado numérico...
Posted: Thu Oct 08, 2015 01:56 PM
mira la clase MSGBAR, hay un metodo que hace lo que buscas, quizas des con el clavo. :-)

ej:
Code (fw): Select all Collapse
METHOD KeybOn() CLASS TMsgBar

   if ::oKeyNum == nil
      // keep the ':=' below for XBase++ compatibility
      ::oKeyNum := TMsgItem():New( Self, "Num", ::GetWidth( "Num" ) + 12,,,, .t.,;
                                  { || KeyToggle( VK_NUMLOCK ), ::oKeyNum:Refresh() } )
      ::oKeyNum:lTimer = .t.
      ::oKeyNum:nClrDisabled = GetSysColor( COLOR_BTNSHADOW )
      ::oKeyNum:lActive = GetKeyToggle( VK_NUMLOCK )
      ::oKeyNum:bMsg  = { || ::oKeyNum:lActive := GetKeyToggle( VK_NUMLOCK ), "Num" }
   endif

   if ::oKeyCaps == nil
      // keep the ':=' below for XBase++ compatibility
      ::oKeyCaps := TMsgItem():New( Self, "Caps", ::GetWidth( "Caps" ) + 12,,,, .t.,;
                                  { || KeyToggle( VK_CAPITAL ), ::oKeyCaps:Refresh() } )
      ::oKeyCaps:lTimer = .t.
      ::oKeyCaps:nClrDisabled = GetSysColor( COLOR_BTNSHADOW )
      ::oKeyCaps:lActive = GetKeyToggle( VK_CAPITAL )
      ::oKeyCaps:bMsg = { || ::oKeyCaps:lActive := GetKeyToggle( VK_CAPITAL ), "Caps" }
   endif

   if ::oKeyIns == nil
      // keep the ':=' below for XBase++ compatibility
      ::oKeyIns := TMsgItem():New( Self, "Ins", ::GetWidth( "Ins" ) + 12,,,, .t.,;
                                  { || KeyToggle( VK_INSERT ), ::oKeyIns:Refresh() } )
      ::oKeyIns:lTimer = .t.
      ::oKeyIns:nClrDisabled = GetSysColor( COLOR_BTNSHADOW )
      ::oKeyIns:lActive = GetKeyToggle( VK_INSERT )
      ::oKeyIns:bMsg = { || ::oKeyIns:lActive := GetKeyToggle( VK_INSERT ), "Ins" }
   endif

   ::CheckTimer()

return nil


Saludos
SkyPe: armando.lagunas@hotmail.com

Mail: armando.lagunas@gmail.com

Continue the discussion