Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
sdl disable keyboard, mouse, cursor
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Charles Goyard  
View profile  
 More options Jan 27 2012, 7:49 am
From: Charles Goyard <c...@fsck.fr>
Date: Fri, 27 Jan 2012 13:49:39 +0100
Local: Fri, Jan 27 2012 7:49 am
Subject: [patch] sdl disable keyboard, mouse, cursor
Hi all,

here's a patch add command-line switches to disable keyboard and mouse
input.

Niels, there's something to review in the patch with respect to vjsdl[].
From the code I see it's possible/planned to have several sdl outputs.
(would be great to know how/to have !). This modification does not take
that into account, it uses info->vjsdl[0].

Cheers,
Charlot

diff --git a/veejay-current/veejay-server/veejay/veejay.c b/veejay-current/veejay-server/veejay/veejay.c
index 43a3031..06eee33 100644
--- a/veejay-current/veejay-server/veejay/veejay.c
+++ b/veejay-current/veejay-server/veejay/veejay.c
@@ -51,6 +51,9 @@ static veejay_t *info = NULL;
 static float override_fps = 0.0;
 static int default_geometry_x = -1;
 static int default_geometry_y = -1;
+static int use_keyboard = 1;
+static int use_mouse = 1;
+static int show_cursor = 0;
 static int force_video_file = 0; // unused
 static int override_pix_fmt = 0;
 static int switch_jpeg = 0;
@@ -244,7 +247,12 @@ static void Usage(char *progname)
                "  -x/--geometry-x <num> \tTop left x offset for SDL video window\n");
        fprintf(stderr,
                "  -y/--geometry-y <num> \tTop left y offset for SDL video window\n");
-
+       fprintf(stderr,
+               "  --no-keyboard \t\t\tdisable keyboard for SDL video window\n");
+       fprintf(stderr,
+               "  --no-mouse \t\t\tdisable mouse for SDL video window\n");
+       fprintf(stderr,
+               "  --show-cursor \t\t\tshow mouse cursor in SDL video window\n");
 #endif
        fprintf(stderr,
                "  -A/--all [num] \t\tStart with capture device <num> \n");
@@ -399,6 +407,15 @@ static int set_option(const char *name, char *value)
        else if (strcmp(name, "geometry-y") == 0 || strcmp(name,"y")==0) {
                default_geometry_y = atoi(optarg);
        }
+       else if (strcmp(name, "no-keyboard") == 0) {
+               use_keyboard = 0;
+       }
+       else if (strcmp(name, "no-mouse") == 0) {
+               use_mouse = 0;
+       }
+       else if (strcmp(name, "show-cursor") == 0) {
+               show_cursor = 1;
+       }
        else if(strcmp(name,"dump-events")==0 || strcmp(name,"u")==0) {
        info->dump = 1;
        }
@@ -495,6 +512,9 @@ static int check_command_line_options(int argc, char *argv[])
        {"dummy",0,0,0},
        {"geometry-x",1,0,0},
        {"geometry-y",1,0,0},
+       {"no-keyboard",0,0,0},
+       {"no-mouse",0,0,0},
+       {"show-cursor",0,0,0},
        {"auto-loop",0,0,0},
        {"fps",1,0,0},
        {"no-color",0,0,0},
@@ -727,7 +747,13 @@ int main(int argc, char **argv)
                veejay_msg(VEEJAY_MSG_ERROR, "Cannot start Vveejay");
                return 0;
        }
-
+#ifdef HAVE_SDL
+       if(info->video_out == 0) {
+               vj_sdl_use_keyboard(info->sdl[0], use_keyboard);
+               vj_sdl_use_mouse(info->sdl[0], use_mouse);
+               vj_sdl_show_cursor(info->sdl[0], show_cursor);
+       }
+#endif
        if(auto_loop)
                veejay_auto_loop(info);

diff --git a/veejay-current/veejay-server/veejay/vj-event.c b/veejay-current/veejay-server/veejay/vj-event.c
index 6717f35..d844c8a 100644
--- a/veejay-current/veejay-server/veejay/vj-event.c
+++ b/veejay-current/veejay-server/veejay/vj-event.c
@@ -1548,12 +1548,6 @@ int      vj_event_parse_msg( void *ptr, char *msg, int msg_len )
                return 1;
        }

-       if( net_id >= 400 && net_id < 499 )
-       {
-               vj_server_client_promote( v->vjs[VEEJAY_PORT_CMD] , v->uc->current_link );
-               v->rmodes[ v->uc->current_link ] = -1000;
-       }
-
        np = vj_event_vevo_get_num_args( net_id );

        if ( msg_len <= MSG_MIN_LEN )
diff --git a/veejay-current/veejay-server/veejay/vj-pjack.c b/veejay-current/veejay-server/veejay/vj-pjack.c
index e1f1265..9c9d599 100644
--- a/veejay-current/veejay-server/veejay/vj-pjack.c
+++ b/veejay-current/veejay-server/veejay/vj-pjack.c
@@ -32,6 +32,7 @@ extern void veejay_msg(int type, const char format[], ...);
 int vj_jack_initialize()
 {
        JACK_Init();
+       JACK_SetClientName("veejay");
        return 0;
 }
 static int _vj_jack_start(int *dri)
@@ -80,7 +81,7 @@ int vj_jack_init(editlist *el)
        int ret = 0;

        JACK_Init();
-
+       JACK_SetClientName("veejay");
        bits_per_sample = 16;
        audio_channels = el->audio_chans;

diff --git a/veejay-current/veejay-server/veejay/vj-sdl.c b/veejay-current/veejay-server/veejay/vj-sdl.c
index 55a43ff..4274142 100644
--- a/veejay-current/veejay-server/veejay/vj-sdl.c
+++ b/veejay-current/veejay-server/veejay/vj-sdl.c
@@ -107,8 +107,8 @@ vj_sdl *vj_sdl_allocate(int width, int height, int fmt)

     vjsdl->flags[0] = 0;
     vjsdl->flags[1] = 0;
-    vjsdl->mouse_motion = 1;
-    vjsdl->use_keyboard = 1;
+    vjsdl->mouse_motion = 0;
+    vjsdl->use_keyboard = 0;
     vjsdl->pix_format = SDL_YUY2_OVERLAY;
     vjsdl->pix_fmt = fmt;
     vjsdl->width = width;
@@ -153,6 +153,30 @@ void vj_sdl_set_geometry(vj_sdl* sdl, int w, int h)

 }

+void vj_sdl_use_keyboard(vj_sdl *vjsdl, int x) {
+       vjsdl->use_keyboard = x;
+       if(vjsdl->use_keyboard == 1)
+               SDL_EventState(SDL_KEYDOWN, SDL_ENABLE);
+       else
+               SDL_EventState(SDL_KEYDOWN, SDL_DISABLE);
+}
+
+void vj_sdl_use_mouse(vj_sdl *vjsdl, int x) {
+       vjsdl->mouse_motion = x;
+       if(vjsdl->mouse_motion == 1)
+               SDL_EventState(SDL_MOUSEMOTION, SDL_ENABLE);
+       else
+               SDL_EventState(SDL_MOUSEMOTION, SDL_IGNORE);
+}
+void vj_sdl_show_cursor(vj_sdl *vjsdl, int x) {
+       vjsdl->show_cursor = x;
+       if (vjsdl->show_cursor == 1)
+               SDL_ShowCursor(SDL_ENABLE);
+       else
+               SDL_ShowCursor(SDL_DISABLE);
+}
+
+
 void vj_sdl_resize( vj_sdl *vjsdl , int scaled_width, int scaled_height, int fs )
 {
        //@ sw_scale_width is misleading ; it lets SDL use the BES
diff --git a/veejay-current/veejay-server/veejay/vj-sdl.h b/veejay-current/veejay-server/veejay/vj-sdl.h
index 3dd0c53..e623b24 100644
--- a/veejay-current/veejay-server/veejay/vj-sdl.h
+++ b/veejay-current/veejay-server/veejay/vj-sdl.h
@@ -66,7 +66,9 @@ void vj_sdl_resize( vj_sdl *vjsdl , int scaled_width, int scaled_height, int fs
 int    vj_sdl_screen_w( vj_sdl *vjsdl );
 int    vj_sdl_screen_h( vj_sdl *vjsdl );
 void   vj_sdl_flip( vj_sdl *vjsdl );
-
+void   vj_sdl_use_keyboard( vj_sdl *vjsdl, int x);
+void   vj_sdl_use_mouse( vj_sdl *vjsdl, int x);
+void   vj_sdl_show_cursor( vj_sdl *vjsdl, int x);

 #endif
 #endif


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Niels Elburg  
View profile  
 More options Jan 27 2012, 10:39 am
From: Niels Elburg <nwelb...@gmail.com>
Date: Fri, 27 Jan 2012 16:39:37 +0100
Local: Fri, Jan 27 2012 10:39 am
Subject: Re: [patch] sdl disable keyboard, mouse, cursor

Hi Charles,

Thanks for the patch, I might merge it into master,
But, I am curious as to why you need no keyboard / no mouse ?

Cheers,
Niels


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Charles Goyard  
View profile  
 More options Jan 27 2012, 11:13 am
From: Charles Goyard <c...@fsck.fr>
Date: Fri, 27 Jan 2012 17:13:29 +0100
Local: Fri, Jan 27 2012 11:13 am
Subject: Re: [patch] sdl disable keyboard, mouse, cursor

Niels Elburg wrote:
> Hi Charles,

> Thanks for the patch, I might merge it into master,
> But, I am curious as to why you need no keyboard / no mouse ?

In fact, I just need no keyboard, to prevent accidental press of some
function key, because the information encoded in the video controls a
motor. Just in case X focus in not in the good window.I just find out
I'll do the same for the mouse and cursor, since everything was in place
already.

So... What's this multi-sdl window code about ;) ?

--
Charlot


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Niels Elburg  
View profile  
 More options Jan 27 2012, 3:07 pm
From: Niels Elburg <nwelb...@gmail.com>
Date: Fri, 27 Jan 2012 21:07:46 +0100
Local: Fri, Jan 27 2012 3:07 pm
Subject: Re: [patch] sdl disable keyboard, mouse, cursor

On Fri, Jan 27, 2012 at 5:13 PM, Charles Goyard <c...@fsck.fr> wrote:
> Niels Elburg wrote:
> > Hi Charles,

> > Thanks for the patch, I might merge it into master,
> > But, I am curious as to why you need no keyboard / no mouse ?

In fact, I just need no keyboard, to prevent accidental press of some

 function key, because the information encoded in the video controls a

motor. Just in case X focus in not in the good window.I just find out


OK, patch accepted! I'll merge it in over the weekend :)

> I'll do the same for the mouse and cursor, since everything was in place
> already.

> So... What's this multi-sdl window code about ;) ?

It's just one of the many features I never entirely worked out, originally
it was intended to have a dual setup, where there's one video on the second
monitor in full screen and a clone of it on the first monitor, but in
windowed mode (for the keyboard/mouse controls).

> --
> Charlot

Niels


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »