update and fmt code

This commit is contained in:
vcaesar 2017-11-23 23:44:41 +08:00
parent 816bfeaba9
commit ac648bde74
4 changed files with 17 additions and 17 deletions

View File

@ -57,7 +57,7 @@ void dispatch_proc(iohook_event * const event) {
// printf("atoi(str)---%d\n", atoi(cevent));
if (akeycode == atoi(cevent)){
int astop = aStop();
// printf("%d\n",astop);
// printf("%d\n", astop);
cstatus = 0;
}
break;
@ -82,7 +82,7 @@ void dispatch_proc(iohook_event * const event) {
if (strcmp(buf, cevent) == 0){
int astop = aStop();
// printf("%d\n",astop);
// printf("%d\n", astop);
cstatus = 0;
}
// return (char*) event->data.keyboard.keychar;
@ -221,7 +221,7 @@ int aEvent(char *aevent) {
}
// return status;
// printf("%d\n",status);
// printf("%d\n", status);
return cstatus;
}

View File

@ -164,7 +164,7 @@ int CheckKeyFlags(char* f, MMKeyFlags* flags)
return 0;
}
int GetFlagsFromValue(char* value[], MMKeyFlags* flags,int num){
int GetFlagsFromValue(char* value[], MMKeyFlags* flags, int num){
if (!flags) {return -1;}
int i;
for ( i= 0; i <num; i++){
@ -185,7 +185,7 @@ char* aKey_Tap(char *k, char* keyarr[], int num){
MMKeyCode key;
switch(GetFlagsFromValue(keyarr, &flags, num)){
// switch (CheckKeyFlags(akey,&flags)){
// switch (CheckKeyFlags(akey, &flags)){
case -1:
return "Null pointer in key flag.";
break;

View File

@ -11,7 +11,7 @@
#include "../base/types.h"
#include "mouse_c.h"
//Global delays.
// Global delays.
int mouseDelay = 10;
// int keyboardDelay = 10;
@ -59,7 +59,7 @@ int aDragMouse(size_t x, size_t y){
dragMouse(point, button);
microsleep(mouseDelay);
// printf("%s\n","gyp-----");
// printf("%s\n", "gyp-----");
return 0;
}
@ -76,7 +76,7 @@ int aMoveMouseSmooth(size_t x, size_t y, double lowSpeed, double highSpeed){
MMPoint aGetMousePos(){
MMPoint pos = getMousePos();
//Return object with .x and .y.
// Return object with .x and .y.
// printf("%zu\n%zu\n", pos.x, pos.y );
return pos;
}
@ -113,7 +113,7 @@ int aMouseToggle(char* d, MMMouseButton button){
}
int aSetMouseDelay(size_t val){
// int val=10;
// int val = 10;
mouseDelay = val;
return 0;

View File

@ -322,8 +322,8 @@ bool IsValid (){
return false;
#elif defined(USE_X11)
mData.XWin=actdata.XWin;
if (mData.XWin == 0)return false;
mData.XWin = actdata.XWin;
if (mData.XWin == 0) return false;
Display *rDisplay = XOpenDisplay(NULL);
// Check for a valid X-Window display
@ -732,8 +732,8 @@ MData GetActive (void){
HWND handle;
handle = GetForegroundWindow();
if (handle != NULL){
// mData.HWnd=(uintptr) handle;
result.HWnd= (HWND)handle;
// mData.HWnd = (uintptr) handle;
result.HWnd = (HWND)handle;
return result;
}
Sleep (20);
@ -767,7 +767,7 @@ void SetTopMost (bool state){
#endif
}
//CloseWindow
// CloseWindow
void CloseWin(void){
// Check window validity
if (!IsValid()) return;
@ -819,7 +819,7 @@ char *GetTitle(){
CFStringGetCString (data, conv,
512, kCFStringEncodingUTF8);
CFRelease (data);
char* s=(char*)calloc(100,sizeof(char*));
char* s = (char*)calloc(100,sizeof(char*));
if(s)strcpy(s,conv);
// return (char *)&conv;
return s;
@ -839,10 +839,10 @@ char *GetTitle(){
// Check result value
if (result != NULL){
// Convert result to a string
char *name=(char*) result;
char *name = (char*) result;
XFree (result);
if (name!=NULL)return name;
if (name != NULL) return name;
}
// Get window title (ASCII)