Skip to content

Commit

Permalink
Support WINCH on JNA+Windows, fixes #67
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Dec 16, 2016
1 parent b856769 commit 0e0ed37
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion src/main/java/org/jline/terminal/impl/jna/win/Kernel32.java
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ class INPUT_RECORD extends Structure {
public static class EventUnion extends Union {
public KEY_EVENT_RECORD KeyEvent;
public MOUSE_EVENT_RECORD MouseEvent;
// WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent;
public WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent;
// MENU_EVENT_RECORD MenuEvent;
// FOCUS_EVENT_RECORD FocusEvent;
}
Expand All @@ -406,6 +406,9 @@ public void read() {
case MOUSE_EVENT:
Event.setType(MOUSE_EVENT_RECORD.class);
break;
case WINDOW_BUFFER_SIZE_EVENT:
Event.setType(WINDOW_BUFFER_SIZE_RECORD.class);
break;
}
super.read();
}
Expand Down Expand Up @@ -445,6 +448,12 @@ protected java.util.List<String> getFieldOrder() {
}
}

// typedef struct _MOUSE_EVENT_RECORD {
// COORD dwMousePosition;
// DWORD dwButtonState;
// DWORD dwControlKeyState;
// DWORD dwEventFlags;
// } MOUSE_EVENT_RECORD;
class MOUSE_EVENT_RECORD extends Structure {
public COORD dwMousePosition;
public int dwButtonState;
Expand All @@ -459,6 +468,20 @@ protected java.util.List<String> getFieldOrder() {
}
}

// typedef struct _WINDOW_BUFFER_SIZE_RECORD {
// COORD dwSize;
// } WINDOW_BUFFER_SIZE_RECORD;
class WINDOW_BUFFER_SIZE_RECORD extends Structure {
public COORD dwSize;

private static String[] fieldOrder = {"dwSize"};

@Override
protected java.util.List<String> getFieldOrder() {
return java.util.Arrays.asList(fieldOrder);
}
}

// typedef struct _SMALL_RECT {
// SHORT Left;
// SHORT Top;
Expand Down

0 comments on commit 0e0ed37

Please sign in to comment.