Jump to content
Sign in to follow this  
shineworld

Disable press and hold in touch screen for a control

Recommended Posts

I'm creating some UI controls using AggPasMod in a touchscreen application.

Some of these controls don't have the Press and Hold feature to simulate Right Mouse click.

 

How to disable this gesture option in them?

Is the square visible when I keep pressed touch for a while in the knob.

 

Thank you in advance for your replies.

 

2021-04-02 09-08-24.7z

Share this post


Link to post

For BDS2006, I've found this solution to disable the press and hold only to required components.
For Sydney there is Touch.TabletOptions does the same things.

 

procedure TAggKnob.WndProc(var Message: TMessage);
const
  WM_TABLET_DEFBASE                     = $02C0;
  WM_TABLET_QUERYSYSTEMGESTURESTATUS    = (WM_TABLET_DEFBASE + 12);
const
  TABLET_DISABLE_PRESSANDHOLD           = $00000001;
  TABLET_DISABLE_PENTAPFEEDBACK         = $00000008;
  TABLET_DISABLE_PENBARRELFEEDBACK      = $00000010;
  TABLET_DISABLE_TOUCHUIFORCEON         = $00000100;
  TABLET_DISABLE_TOUCHUIFORCEOFF        = $00000200;
  TABLET_DISABLE_TOUCHSWITCH            = $00008000;
  TABLET_DISABLE_FLICKS                 = $00010000;
  TABLET_ENABLE_FLICKSONCONTEXT         = $00020000;
  TABLET_ENABLE_FLICKLEARNINGMODE       = $00040000;
  TABLET_DISABLE_SMOOTHSCROLLING        = $00080000;
  TABLET_DISABLE_FLICKFALLBACKKEYS      = $00100000;
  TABLET_ENABLE_MULTITOUCHDATA          = $01000000;
var
  P: TPoint;
begin
  case Message.Msg of
    WM_TABLET_QUERYSYSTEMGESTURESTATUS:
    begin
      Message.Result :=
      (
        TABLET_DISABLE_PRESSANDHOLD or
        TABLET_DISABLE_PENTAPFEEDBACK or
        TABLET_DISABLE_PENBARRELFEEDBACK or
        TABLET_DISABLE_TOUCHUIFORCEON or
        TABLET_DISABLE_TOUCHUIFORCEOFF or
        TABLET_DISABLE_TOUCHSWITCH or
        TABLET_DISABLE_FLICKS or
        TABLET_DISABLE_SMOOTHSCROLLING or
        TABLET_DISABLE_FLICKFALLBACKKEYS
      );
      P.X := TWMMouse(Message).XPos;
      P.Y := TWMMouse(Message).YPos;
      P := ScreenToClient(P);
      MouseDown(mbLeft, [], P.X, P.Y);
      Exit;
    end;
  end;
  inherited WndProc(Message);
end;

 

Edited by shineworld

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×